How to get the maximum and minimum values in a dictionary with Python

1 Answer

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

max_value = max(dic.values())
min_value = min(dic.values())

print(max_value) 
print(min_value) 

 
 
'''
run:
 
89
12
 
'''

 



answered Dec 17, 2024 by avibootz
...