dict.clear()
dict.clear() works on a dictionary — labelled data like marks["Asha"] = 90. Keys map to values. Loop with .items() when you need both.
dict.clear() — output — {}.
Trap for dict.clear() — writing d[missing] in a viva. Prefer get when the key might not exist.
{ "Asha": 90, "Ravi": 85 }
│ │
key valueExam tip
get vs [] — one sentence + tiny dict of marks.