Q5Single correct3 Marks31 Aug 2025
Given the following code snippet, what will be the output?
```
def update_records(records, updates):
for key, value in updates.items():
if key in records and isinstance(records[key], dict):
for sub_key, sub_val in value.items():
if sub_key in records[key]:
records[key][sub_key] += sub_val
else:
records[key][sub_key] = sub_val
else:
records[key] = value
return records
data = { "A": {"x": 10, "y": 20}, "B": {"x": 5, "z": 15}, "C": 100 }
updates = { "A": {"y": 20, "z": 5}, "B": {"y": 10}, "C": {"x": 10}, "D": {"w": 7} }
result = update_records(data, updates)
print(result)
```