Answers for "get indice of the smallest value in dict python"

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
2

python find smallest value in list

stuff = [37, 7, 19, 29, 5, 13, 31, 17, 23, 11, 3, 2]
print(min(stuff))
# output = 2
Posted by: Guest on December-22-2020

Code answers related to "get indice of the smallest value in dict python"

Python Answers by Framework

Browse Popular Code Answers by Language