python 2.7 - How to find the position of letters in a list of words? -


in list of words :

acquired almanac insult joke hymn gazelle amazon eyebrows affix vellum 

for e.g.:how find position of 'a'; 'a'

def find_a(input):     i, c in enumerate(input):         if c == 'a': yield 

will return character position of as


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

ios - Possible to get UIButton sizeThatFits to work? -