Guest User

Untitled

a guest
Jan 6th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. def findindex(findme, inthelist):
  2. '''returns the index of the first argument in the second argument list'''
  3. return [y for y, x in enumerate(inthelist) if x == findme]
  4.  
  5. # example
  6. # findindex("name",["name","home","house"])
  7. # findindex("1","1010101010")
Add Comment
Please, Sign In to add comment