Dictionaries and sets
A dictionary maps keys to values:
ages = {"Anna": 12, "Tim": 14}
ages["Leia"] = 11 # add
print(ages["Anna"]) # 12
print(ages.get("Max", 0)) # 0 — if the key is missing
for name, age in ages.items():
print(name, age)
A set stores only unique values and can find what two sets share:
a = {1, 2, 3}
b = {2, 3, 4}
print(a & b) # {2, 3} — intersection
print(a | b) # {1, 2, 3, 4} — union