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 - See results only from geeksforgeeks.org
Python Dictionary get() M…
Python Dictionary get () Method return the value for the given key if present in the …
Python | Get key from value …
value = {i for i in dic if dic[i]=="B"} print("key by value:",value) Output: key by value: …
Python Dict Get Value by Ke…
The get() method is a built-in method for dictionaries that allows you to retrieve …
Dictionaries in Python - Gee…
Dictionaries in Python is a data structure, used to store values in key:value format. …
Extract Dictionary Value fro…
Sometimes, while working with dictionaries, we can face a problem in which we may …
How to Change the name o…
Method 2: Using Dictionary Comprehension. You can use dictionary …
- Question & Answer
Get a value from a dictionary by key in Python | note.nkmk.me
Get Keys and Values from a Dictionary in Python - Stack Abuse
- People also ask
How To Get the Key By Value In a Dictionary In Python - Stack …
WEBMay 28, 2024 · 1. 2. myDict = {'one': 'Ram', 'two': 13, 'three': 'Jordge', 'four': 'Gill', 'five': 33, 'six': 'Steve'}; print(myDict.get("one")); Output. Ram. The above example contains 6 elements with both keys and the associated …
Python Dictionary - Python Tutorial
Python | Dictionaries | .get() | Codecademy
5 Best Ways to Get a Key From a Value in a Python Dictionary
Python Dictionary get() Method - W3Schools
Python dictionary get() Method - Online Tutorials Library
Python Dictionary (With Examples) - Programiz
c# - Get dictionary key by value - Stack Overflow
Get Dictionary key by using the dictionary value - Stack Overflow
What is Azure—Microsoft Cloud Services | Microsoft Azure
How to retrieve the value in a Dictionary based on key in VBA
javascript - Finding a key/value pair in a list - Stack Overflow
How to get MySQL result values as string or number?
- Some results have been removed