Report Bug

Qus

What is printed?

i = 1
while i < 4:
    print(i, end=" ")
    i += 1
else:
    print("Done")
Qus

निम्न code क्या print करेगा?

i = 1
while i < 4:
    print(i, end=" ")
    i += 1
else:
    print("Done")


A. 1 2 3
B. Infinite loop
C. Done
D. 1 2 3 Done


Solution
D. 1 2 3 Done



Explanation
<p><span style="font-size: 14px;">The loop prints 1, 2 and 3. Since it terminates normally, the else block executes.</span></p><p><span style="font-size: 14px;"><br></span></p><p><span style="font-size: 14px;"><br></span></p><p><span style="font-size: 14px;">&nbsp;Loop 1, 2, 3 print करता है और normal termination के बाद else block "Done" print करता है।</span></p>
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad