dict.keys()
dict.keys() works on a dictionary — labelled data like marks["Asha"] = 90. Keys map to values. Loop with .items() when you need both.
dict.keys() — output — ['Asha', 'Ravi'].
Trap for dict.keys() — 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.