How to find the key associated with the minimum value in a dictionary with Python

1 Answer

0 votes
dic = {'key1':34, 'key2':48, 'key3':89, 'key4':13, 'key5':50}

min_key = min(dic, key=dic.get)

print(min_key)

 
 
'''
run:
 
key4

'''

 



answered Dec 17, 2024 by avibootz

Related questions

...