- 1
give the answer with explain. b=20 while True: if b<9: break b=b-9 print(b)
Give the explain of this code https://code.sololearn.com/cBrITpTxuJz3/?ref=app https://code.sololearn.com/Wnv4dum5u6E7/?ref=app
1 Respuesta
0
Output will be :
11
2
It's because the print statement is inside the while block, thus the value of variable 'b' gets 20-9= 11 and prints it, goes back inside the while block and performs the operation, where it gets 2 (11-9=2) which is less than 9, thus it breaks out of loop.