Answers for "find min key in dictionary python"

5

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(min_key)
# print output => "a"
Posted by: Guest on April-25-2021

Code answers related to "find min key in dictionary python"

Python Answers by Framework

Browse Popular Code Answers by Language