holypython
holypython copied to clipboard
using max() on a dictionary is confusing
Python dictionary exercises Lesson8-j and Lesson8-k
Max function to get the key with the highest value
The wording is unclear and the dictionary values unhelpfully mix strings and integers. Students may expect ans_1 = max(dict) to return "son's height" as it has the highest value however it returns "son's weight" as it contains the letter closest to "z"