Bonus Points
Python
25 pts
Bonus Points
Selam’s marks are stored in a dictionary:
marks = {"math": 72, "english": 85, "science": 64}
- The teacher gives 5 bonus points in math and in science. Add 5 to each value using its current value — do not type the new numbers yourself.
- Selam re-sat the English exam: use
update()to set"english"to90. - Create
total, the sum of all the marks. Usesum(marks.values()). - Print
marks, thentotal.
Expected output:
{'math': 77, 'english': 90, 'science': 69}
236
Checklist
- Add 5 bonus points to math and science, using their current values.
- Set English to its new mark with
update(). - Create
total, the sum of all the marks. - Print
marks, thentotal.
🔑 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.
