Answers for "all the positions of a letter occurrences in a string python"

0

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]
Posted by: Guest on May-17-2021

Code answers related to "all the positions of a letter occurrences in a string python"

Python Answers by Framework

Browse Popular Code Answers by Language