I am trying to write a code that finds index of a character in a string. This is I wrote so far. It shows me 3 two times. The first 'o' is indeed 3, and there are two o. But why does it give me 3 instead of 11?
my_string = 'I love my dogs!'
for char in my_string:
if char == 'o':
print(my_string.index(char))