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/