NIELIT O Level Exam

<p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">d = {0: 'a', 1: 'b', 2: 'c'}<br></span><span style="font-size: 14px;">for x, y in d.items():<br></span><span style="font-size: 14px;">&nbsp; &nbsp; print(x, y)</span></pre><div>A)</div><div><br></div><div>0</div><div>1</div><div>2</div><div><br></div><div>B)</div><div><br></div><div>a</div><div>b</div><div>c</div><div><br></div><div>C)</div><div>0 a</div><div>1 b</div><div>2 c</div><div><br></div><div>D)</div><div>None of the Above</div><div><br></div>

What will be the output of the following Python code?

d = {0: 'a', 1: 'b', 2: 'c'}
for x, y in d.items():
    print(x, y)
A)
0
1
2
B)
a
b
c
C)
0 a
1 b
2 c
D)
None of the Above


निम्नलिखित Python कोड का आउटपुट क्या होगा?

d = {0: 'a', 1: 'b', 2: 'c'}
for x, y in d.items():
    print(x, y)
A)
0
1
2
B)
a
b
c
C)
0 a
1 b
2 c
D)
None of the Above


A. Option A

B. Option B

C. Option C

D. Option D




Correct Answer is :

C. Option C



Explanation
Loops over key, value pairs.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad