Hi I am confused with regard to below code

atpos=data.find(@)
print(atpos)
sppos=data.find(’ ‘,atpos)
Hi, Why we want to use atpos in the above line of code if we only want to find the space, why cant we simply write
sppos=data.find(’ ') to find the space. thanks

Hi, Navjot.

Here, in line 3, if you only write sppos=data.find(’ ‘), this will give the index of the first space ’ ’ that is “4”, but in the code sppos=data.find(’ ', atpos) we are trying to find the index of the “space” after the “@”
( that is stored in atpos ) index of 22, so you will get the space at 32.

All the best