0

i am facing this problem again and again that 'break' is "outside the loop".can anyone help me to understand this

https://code.sololearn.com/caQQmFBOGG0a/?ref=app https://code.sololearn.com/caQQmFBOGG0a/?ref=app

3rd Apr 2020, 12:00 PM
HAMZA
2 Réponses
0
do this i= 20 while i>10 print(i) i+=1 if i == 100 break
3rd Apr 2020, 12:17 PM
Marco
Marco - avatar
0
i=20 while i>10: print(i) i+=1 if i==100: break #notice that in lime 5 (if) statement should come under while loop. And after (if) the break should be indented under (if)
3rd Apr 2020, 12:19 PM
Tricker