Examveda

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

A. my_dict['new_key'] = new_value

B. add('new_key', new_value)

C. insert('new_key', new_value)

D. append('new_key', new_value)

Answer: Option A


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python