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.
  • any and all are easy to mix up. "Did everyone pass?" is an all question.

Assignment

  1. Fix top_scorer(names, scores) so it returns the name with the highest score.
  2. Fix all_passed(scores, pass_mark) so it's True only when every score is at least pass_mark.

The program should print Bo and then False.