access key in dictionary python using values code example
Example 1: how to get key of a particular value in dictionary python using index
mydict = {'george': 16, 'amber': 19}
print(list(mydict.keys())[list(mydict.values()).index(16)]) # Prints george
Example 2: get all keys and values from dictionary python
#python 3
for k,v in dict.items():
print(k, v)