saluton al ciuj

i know how to get item by key

==================
dict = {10 : 50, 2 : 12, 4 : 43}

print dict[2]

12

but i wonder how to get key by item

print dict[12]

2
==================


is there a more fast way than that one (my dictionary is really big) ================== dict = {10 : 50, 2 : 12, 4 : 43} item = 12 for key in dict.keys(): if dict[key] == item: print key break ================== -- http://mail.python.org/mailman/listinfo/python-list

Reply via email to