About 3,870,000 results
Bokep
- Viewed 2.5m times960edited Mar 10, 2020 at 22:51mydict = {'george': 16, 'amber': 19}print mydict.keys()[mydict.values().index(16)] # Prints george
Or in Python 3.x:
mydict = {'george': 16, 'amber': 19}print(list(mydict.keys())[list(mydict.values()).index(16)]) # Prints georgeBasically, it separates the dictionary's values in a list, finds the position of the value you have, and gets the key at that position.
More about keys() and .values() in Python 3: How can I get list of values from dict?
Content Under CC-BY-SA license python - Get key by value in dictionary - Stack Overflow
Explore further
Python | Get key from value in Dictionary - GeeksforGeeks
Python Dictionary Find Key By Value - Python Guides
- Question & Answer
Get keys from a dictionary by value in Python | note.nkmk.me
How To Get the Key By Value In a Dictionary In Python - Stack …
Get a value from a dictionary by key in Python | note.nkmk.me
- People also ask
How to get the key from value in a dictionary in Python?
5 Best Ways to Get a Key From a Value in a Python Dictionary
Python - Access Dictionary Items - W3Schools
Get key from value in dictionary - PythonForBeginners.com
How to access a Dictionary Key by Index in Python | bobbyhadz
Get key by value in dictionary - W3docs
Python Dictionary get() - Programiz
Python Get Dictionary Value by Key - GeeksforGeeks
How to Find Key by Value in Python Dictionary | Delft Stack
Python : How to find keys by value in dictionary - thisPointer
Getting the Key Associated with a Value in a Dictionary
Python Get Dictionary Value By Key - Tutorialdeep
Iterate through dictionary keys and values in Python
How to Add Duplicate Keys in Dictionary Python - GeeksforGeeks
What are the two arguments expected by the get method for a …
Why dict.get (key) instead of dict [key]? - Stack Overflow
What is Project 2025? The Presidential Transition Project explained.
What Changes Would a Far-Right Government Bring to France?
Python Dictionary get value of Key - Stack Overflow
Is there any way to check if a KeyValuePair<string, int> contains …
- Some results have been removed