python find value of key code example
Example 1: python get value from dictionary
dict = {'color': 'blue', 'shape': 'square', 'perimeter':20}
dict.get('shape') #returns square
#You can also set a return value in case key doesn't exist (default is None)
dict.get('volume', 'The key was not found') #returns 'The key was not found'
Example 2: how to get the value of key in python
print(dict["key"])
Example 3: find key by value python
print(list(d.keys())[list(d.values()).index(990)])