Python cannot seem to differentiate between duplicates of the same letter. For example:
word = "australia"
variable = "a"
for letter in word:
if variable == letter:
index = word.index( letter )
print index
The result is:
0
0
0
While python knows that there are three occurrences of the letter "a" in the word "australia", it keeps returning the index of the first occurrence. How can I fix this? Thanks.