QUESTION IMAGE
Question
question # 5
multiple choice
which statement adds a new item to a dictionary?
○ books.append((5:2))
○ books.insert((5:2))
○ books.update((5:2))
○ books.add((5:2))
Brief Explanations
In Python, the update method is used to add new key - value pairs (items) to a dictionary. The append method is for lists, insert is also for lists to insert an element at a specific position, and there is no add method for dictionaries in the way shown.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
books.update({5:2})