Python - While Loop
Consider this code:
n = 5
while n > 0:
if n == 3:
break
print(n)
n -= 1
else:
print('Loop completed')What will be the output and why?
Consider this code:
n = 5
while n > 0:
if n == 3:
break
print(n)
n -= 1
else:
print('Loop completed')What will be the output and why?
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions