NIELIT O Level Exam

<p>What is the output of following?</p><pre><span style="font-size: 14px;">for i in range(3):<br></span><span style="font-size: 14px;">&nbsp; &nbsp; pass<br></span><span style="font-size: 14px;">print(i)</span></pre>

What is the output of following?

for i in range(3):
    pass
print(i)


निम्न code का output क्या होगा?

for i in range(3):
    pass
print(i)

A. 0

B. 1

C. 2

D. Error




Correct Answer is :

C. 2



Explanation
range(3) produces 0, 1, 2. After the loop, i retains its last value, 2.

range(3) से 0, 1, 2 मिलते हैं। Loop समाप्त होने के बाद i की अंतिम value 2 रहती है।
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad