Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
How to predict key from its value in python?
Asked
Jun 24 '17 at 22:15
Active
Jun 24 '17 at 22:15
Viewed
23 times
0
Suppose we have list like this:
tokens=["apple":1,"zebra":2]
Then how to find apple using value 1?
python-3.x
numpy
asked Jun 24 '17 at 22:15
Maitreya Patel
21
2
7
1
There can be *multiple* keys that map on the same value...
–
Willem Van Onsem
Jun 24 '17 at 22:17
3
Furthermore you write something between a dictionary and a list. This is not valid Python.
–
Willem Van Onsem
Jun 24 '17 at 22:17
check out this: https://stackoverflow.com/questions/8023306/get-key-by-value-in-dictionary
–
Burnie777
Jun 24 '17 at 22:18
Thanks you all guys for helping me. Specially thanks to @Burnie777.
–
Maitreya Patel
Jun 24 '17 at 22:30
0 Answers
0