Reputation: 11
In a list of words :
ACQUIRED
ALMANAC
INSULT
JOKE
HYMN
GAZELLE
AMAZON
EYEBROWS
AFFIX
VELLUM
for e.g.:How do I find the position of an 'A'; it could be any 'A'
Upvotes: 0
Views: 53
Reputation: 280
def find_A(input):
for i, c in enumerate(input):
if c == 'A': yield i
will return the character position of all the As
Upvotes: 1