Howto find dict members from a list of keys

Alexander Eisenhuth newsuser at stacom-software.de
Thu Mar 8 09:20:20 CET 2007


Hello,

what algo do you use, when you want to find the dict values from d, with members 
of l. Following example:

 >>> d = {1:2,2:3,3:4,4:5,5:6,6:7,7:8,8:9,9:10}
 >>> l = [7,8]
 >>> found_dic_members = <yourCode>
 >>> print found_dict_members
[8,9]

Thanks
Alexander



More information about the Python-list mailing list