What will be the output of the following Python program? i = 0 while i < 5: print(i) i += 1 if i == 3: break else: print(0)

Questions & AnswersCategory: Programming LanguageWhat will be the output of the following Python program? i = 0 while i < 5: print(i) i += 1 if i == 3: break else: print(0)
Geek Boy Staff asked 2 years ago

What will be the output of the following Python program?

i = 0
while i < 5:
    print(i)
    i += 1
    if i == 3:
        break
else:
    print(0)

a. error
b. 0 1 2 0
c. 0 1 2
d. none of the mentioned