CBSE · 083Class XII · 2025Section B1 mark
Question 24ii
4 March 2025 · Computer Science (083)
(ii) (a) Write a statement to append all the key-value pairs of the dictionary D to the dictionary D1.
Answer
python
D1.update(D)Explanation
The update() method adds element(s) to the dictionary if the key is not in the dictionary. If the key is in the dictionary, it updates the key with the new value.