Vidyalelo
Python · Q28

MCQs for Python Dictionaries: Exam

Programming · Python · question 28

Q28

What is the output of the following code:my_dict = 'a': 1, 'b': 2new_dict = my_dict.copy()print(new_dict)

A.
{'a': 1, 'b': 2}
Answer
B.
{'a': 1, 'b': 2, 'a': 1, 'b': 2}
C.
{'a': 1, 'b': 2, 'a': 2, 'b': 1}
D.
{'a': 2, 'b': 1}

Answer: Option A

Solution

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