I guess the heading is self-explanatory, still, I'll make myself more clear.
I've to find the indexes of every occurrence of a character in a string. For example,
word = "banana"
def indexes(x, word):
#some code
return (list of indexes of x character in the word)
output:
indexes('a', word)
>> [1, 3, 5]
How do I get this result?