0

What is the output of described coding?

i = 2 while 1==1 : print(i) if i >20: 'break' else: i=i+2

23rd Jan 2017, 8:38 PM
prakash
2 Respostas
+ 6
that will be an Infinite loop cause the while condition will always be true, u need to put the if/else inside the while loop and break without quotes
23rd Jan 2017, 8:41 PM
Kawaii
Kawaii - avatar
0
the program will never execute the if statement block since the upper block is an infinite loop. It will print 2 infinitely.
23rd Jan 2017, 11:12 PM
Godji Fortil (iamgodji)
Godji Fortil (iamgodji) - avatar