निम्नलिखित प्रोग्राम का आउटपुट क्या है?
What is the output of the following program ?
i=0
while i<3:
print(i)
i+=1
else:
print 0 A
0 1 2 3 0
B
0 1 2 0
C
0 1 2
D
Error
Explanation
The program prints the values of i from 0 to 2 inside the while loop, and then prints 0 from the else block after the loop finishes.
Output:
(B) 0 1 2 0
while लूप 0, 1, 2 प्रिंट करेगा। जब कंडीशन i < 3 गलत हो जाएगी, तब else ब्लॉक चलेगा और 0 प्रिंट करेगा
Correct Answer: B) 0 1 2 0