python string name out of mail 1

python string name out of mail

s.split("@")[0]

Here is what the above code is Doing:
1. We’re using the split() method to split the string at the @ symbol.
2. We’re using the [0] index to get the first part of the string.

Similar Posts