Vidyalelo
Python · Q26

MCQs for Python Dictionaries: Exam

Programming · Python · question 26

Q26

What will be the output of the following code:my_dict = 'a': 1, 'b': 2, 'c': 3my_dict.items()print(my_dict)

A.
{'a': 1, 'b': 2, 'c': 3}
Answer
B.
[('a', 1), ('b', 2), ('c', 3)]
C.
{('a': 1), ('b': 2), ('c': 3)}
D.
{'items': [('a', 1), ('b', 2), ('c', 3)]}

Answer: Option A

Solution

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