Python Dictionary Methods
Dict methods read, update, or remove pairs. get(key, default) is the safe read. keys / values / items for loops. update merges another dict. setdefault(key, default) inserts only if the key is new. pop(key) removes and returns the value. popitem() removes one pair. clear() empties the dict.
Loop: for k, v in marks.items(): print(k, v). setdefault vs get: get never inserts; setdefault inserts the default when missing. That one-line difference is the viva.
Python Dictionary Methods — output — ['name', 'city'], then Pune, then {'name': 'Asha'}.
{ "Asha": 90, "Ravi": 85 }
│ │
key valuesetdefault vs get difference in one line.