Class Results and the Best Student
Python
25 pts
Class Results and the Best Student
Two tuples are given: names and marks. The mark at each index belongs to the name at the same index.
- Loop with
range(len(names))and print a numbered line for each student, like1. Selam: 78. - In the same loop, find the student with the highest mark. Store their name in
best. - After the loop, print
Best:and the name.
Expected output:
1. Selam: 78 2. Abel: 92 3. Merhawi: 85 Best: Abel
Checklist
- Keep
namesandmarksunchanged and loop over the indexes withrange(len(names)). - In the same loop, find the highest mark. Store it in
best_markand the student's name inbest. - Print a numbered line for each student, then
Best:and the name.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
