Q3Single correct3 Marks31 Aug 2025
Consider the below code snippet. What will be the output of the code?
```
def updated_val(d, key, val):
if key in d:
d[key] += val
else:
d[key] = val
return d[key]
my_dict = {'a': 2, 'b': 3}
print(updated_val(my_dict, 'c', 4) + updated_val(my_dict, 'c', 2) + updated_val(my_dict, 'a', 2))
```