Report Bug

Qus

What is the output of following?

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

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

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


A. 0
B. 1
C. 2
D. Error


Solution
C. 2



Explanation
range(3) produces 0, 1, 2. After the loop, i retains its last value, 2. <br><br>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