Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question # 5 multiple choice which statement adds a new item to a dicti…

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))

Explanation:

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.

Answer:

books.update({5:2})