Update the Bus Information
Python
15 pts
Update the Bus Information
A bus company stores one route like this:
bus = {"route": "Asmara - Keren", "seats": 40, "fare": 50}
- Change
"fare"to60using square brackets. - With one
update(), change"seats"to45and"route"to"Asmara - Massawa". - Print
bus.
Expected output:
{'route': 'Asmara - Massawa', 'seats': 45, 'fare': 60}
Checklist
- Keep
busas a dictionary with only its three keys. - Change the fare with square brackets.
- Change the seats and the route together with one
update(). - Print
bus.
🔑 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.
