Vidyalelo
Python · Q39

MCQs for Python Dictionaries: Exam

Programming · Python · question 39

Q39

What will be the output of the following Python code? >>> a=1:"A",2:"B",3:"C" >>> a.items()

A.
Syntax error
B.
dict_items([('A'), ('B'), ('C')])
C.
dict_items([(1,2,3)])
D.
dict_items([(1, 'A'), (2, 'B'), (3, 'C')])
Answer

Answer: Option D

Solution

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