+ 3

How to find key if have innervalue?

d={"apple":{"num": 3}, "Orange":{"num": 1}} if I have 3 how to fine apple or have 1 how to find orange?

2nd Mar 2017, 11:57 AM
hamid
hamid - avatar
2 odpowiedzi
+ 1
I find that : x=111 for k,v in d.items(): if x in v.values(): print(k)
2nd Mar 2017, 12:50 PM
hamid
hamid - avatar