hello
my question is if a #string contains two or three of the same letter for instance “preceeding”, we create a new variable called e and set it to “e”. At what index of the string “preceeding” is the character ??
help please
This is one of questions you can ask python itself. And, indeed, you probably should. It will give you a better idea of how things work.
Perhaps something like:
s = 'preceeding'
i = s.find('e')
print(s,i)
1 Like