Objective
Create a Python program that finds the student with the highest grade using max with key.
Instructions
- Read an integer
nand thennlines with the formatname grade(the grade is an integer). - Store each student as a tuple
(name, grade)in a list. - Get the one with the highest grade with
max(students, key=lambda s: s[1]). If there is a tie, the first one is kept. - Show
Best: name (grade).
4
ana 7
luis 9
eva 5
marta 9
Best: luis (9)
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise