About 810,000 results
Any time
Open links in new tab
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
Access Dictionary Values | Python Tutorial - GeeksforGeeks
- Question & Answer
Add a key value pair to Dictionary in Python - GeeksforGeeks
Get Keys and Values from a Dictionary in Python - Stack Abuse
Python | Get key from value in Dictionary - GeeksforGeeks
Dictionaries in Python – Real Python
WEBThe Python dictionary .get() method provides a convenient way of getting the value of a key from a dictionary without checking ahead of time whether the key exists, and without raising an error. d.get(<key>) searches …
- People also ask
Python Dictionary - Python Tutorial
Python Access Dict Entries (with Best Practices) - PythonHello
Python - Access Dictionary Items - W3Schools
Python Get Dictionary Value by Key - GeeksforGeeks
Iterate through dictionary keys and values in Python
Key-Value Operations with Dictionaries - Dive Into Python
How can I add new keys to a dictionary? - Stack Overflow
5. Data Structures — Python 3.13.0 documentation
Python Dictionaries - W3Schools
Iterating over dictionaries using 'for' loops - Stack Overflow
Immortal object refcnt is decreased - Discussions on Python.org
KPMG 2024 Technology and Telecommunications CEO Outlook
Python Iterate Dictionary Key, Value - GeeksforGeeks
Check if a given key already exists in a dictionary