PYTHON CORE · LESSON 45
The key may not be.
Method get in the dictionary · about 10 minutes
Learning with progressRead the summary for free. To save the work, log in to the account.
Type the code yourself
Reprint the spare value example.
game = {"score": 3}
print(game.get("lives", 0))Open the editor for class workSolve it yourself
Create book with a title key and a «Космос» value. Using get, output the value of the pages key, and if not, 0.
The answer is hidden. Use similar examples from the lesson notes.
Opening up your homework