Report Bug

Qus: <p>What will be the output of the following Python code?</p> <pre>a={1:"A",2:"B",3:"C"}<br>print(a.items())</pre>

Qus<p>निम्नलिखित Python कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">a={1:"A",2:"B",3:"C"}<br>print(a.items())</pre>


A. सिंटेक्स एरर
B. dict_items([(‘A’), (‘B’), (‘C’)])
C. dict_items([(1,2,3)])
D. dict_items([(1, ‘A’), (2, ‘B’), (3, ‘C’)])


Solution
D. dict_items([(1, ‘A’), (2, ‘B’), (3, ‘C’)])



Explanation
The method items() returns list of tuples with each tuple having a key-value pair.
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test , CCC MCQ Python Coding Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Website development Company in Allahabad