
Bug hunt
The Crooked Scoreboard
The Guild's trial scoreboard is announcing the wrong winner, and it says everyone passed even though Cy clearly didn't.
Two realistic mistakes are hiding here:
max()on tuples compares the first element first. With(name, score)pairs, that finds the alphabetically last name, not the best score.anyandallare easy to mix up. "Did everyone pass?" is anallquestion.
Assignment
- Fix
top_scorer(names, scores)so it returns the name with the highest score. - Fix
all_passed(scores, pass_mark)so it'sTrueonly when every score is at leastpass_mark.
The program should print Bo and then False.
- Fix
top_scorer(names, scores)so it returns the name with the highest score. - Fix
all_passed(scores, pass_mark)so it'sTrueonly when every score is at leastpass_mark.
The program should print Bo and then False.
main.py Python sleeping
Press Run to try your code, then Check to test it.