Class Marks Lookup
Python
25 pts
Class Marks Lookup
The marks of a class are stored like this:
marks = {"Selam": 88, "Abel": 74, "Merhawi": 91}
- Create
students, a list of all the keys. - Create
all_marks, a list of all the values. - Create
top_mark, the highest mark. Use the built-inmax()function onall_marks. - Create
lidya_markwithget(). Lidya is not in the dictionary, so the default must be0. - Print the four variables, one per line.
Expected output:
['Selam', 'Abel', 'Merhawi'] [88, 74, 91] 91 0
Checklist
- Create
students, a real list of all the names, without changingmarks. - Create
all_marks, a list of all the marks. - Find the highest mark and store it in
top_mark. - Look up Lidya safely in
lidya_mark, with0as the default. - Print the four variables, one per line.
🔑 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.
