Dictionary XI CS Worksheet
Dictionary XI CS Worksheet
8. What happens if you try to access a key that does not exist in a dictionary using square
brackets?
○ a) Returns None b) Throws a KeyError
○ c) Creates a new key with None as value d) Deletes the dictionary
9. How can you merge two dictionaries in Python (3.9 and above)?
○ a) Using + operator b) Using merge()
○ c) Using update() d) Using | operator
○ a) 1 b) 2 c) 3 d) Error
Part B: Case-Based Questions [4 Marks Each]