[Solved] Slicing in Python, one part of string


dotPoint = text.index(".")
atPoint = text.index("@")
firstPart = text[0:dotPoint]
secondPart = text[dotPoint+1:atPoint]
print firstPart
print secondPart

This will output

bianca
mary

There you go. On Python 2.7 🙂

2

solved Slicing in Python, one part of string