Finding the key to a value

Wednesday, Dec 26, 2007

Use a list comprehension:

hit = [k for k,v in dict.items() if v==lookingfor]