Answers for "get the smallest value from a dictionary value"

4

python find smallest element in dictionary

d = {"A":3, "B":1, "C":100}

# find key with lowest value
best_key = min(d, key=d.get)

print(best_key)
# output: B
Posted by: Guest on November-29-2020

Code answers related to "get the smallest value from a dictionary value"

Python Answers by Framework

Browse Popular Code Answers by Language