python find positions of all occurrences in string code example
Example: all the positions of a letter occurrences in a string python
s = 'Apples are totally awesome'
l = [idx for idx, item in enumerate(s.lower()) if 'a' in item]
print(l)
#output: [0, 7, 14, 19]