E
Egor Bolonev
saluton al ciuj
i know how to get item by key
==================
dict = {10 : 50, 2 : 12, 4 : 43}
print dict[2]
but i wonder how to get key by item
print dict[12]
==================
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
==================
i know how to get item by key
==================
dict = {10 : 50, 2 : 12, 4 : 43}
print dict[2]
but i wonder how to get key by item
print dict[12]
==================
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
==================