The big little idea
A dictionary stores pairs of keys and values. You can look up a value by its key instead of remembering its position. It is perfect for a game character’s information.
hero = {"name": "Bit", "level": 1}
hero["level"] = 2
print(hero["name"])
print(hero["level"])Use curly braces for a dictionary and a colon between each key and value. hero["level"] reads a value; hero["level"] = 2 updates it. The key must exist when you look it up with square brackets.