Lesson 4 of 7
Dictionaries: labelled data
A dictionary describes one thing with labels: song = {"title": "Neon", "plays": 120}.
Read with song["plays"], modify with song["plays"] = …, and add a new label the same way.
song = {"title": "Neon", "plays": 120}
song["plays"] = song["plays"] + 1
song["liked"] = True🎯 Your goal
The track song = {"title": "Neon", "plays": 120} just got played: increase plays by 1, add the "liked" label with the value True, then print song["plays"].
PRO lesson
This advanced chapter is part of CodeAge PRO. Unlock it to keep your adventure going.
Discover PRO →