holypython icon indicating copy to clipboard operation
holypython copied to clipboard

using max() on a dictionary is confusing

Open Crush-Steelpunch opened this issue 4 years ago • 0 comments

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"

Crush-Steelpunch avatar Dec 09 '21 15:12 Crush-Steelpunch