Answers for "python min of dictionary value"


python min in dictionary

a_dictionary = {"a": 1, "b": 2, "c": 3}

# get key with min value
min_key = min(a_dictionary, key=a_dictionary.get)

# print output => "a"
Posted by: Guest on April-25-2021

python get min max value from a dictionary

d = {'A': 4,'B':10}
min_v = min(zip(d.values(), d.keys()))
# min_v is (4,'A')

max_v = max(zip(d.values(), d.keys()))
# max_v is (10,'B')
Posted by: Guest on November-17-2020

Code answers related to "python min of dictionary value"

Python Answers by Framework

Browse Popular Code Answers by Language