Vidyalelo
Python · Q19

MCQs for Python Dictionaries: Exam

Programming · Python · question 19

Q19

How can you add a new key-value pair to a dictionary in Python?

A.
my_dict['new_key'] = new_value
Answer
B.
add('new_key', new_value)
C.
insert('new_key', new_value)
D.
append('new_key', new_value)

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board