On 24/10/11 19:00, Alan Gauld wrote:
For fun:

def getKeys(aDict, aValue):
    return [key for key,val in aDict if val == aValue]

Oops, that should have been

     return [key for key,val in aDict.items() if val == aValue]


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to