+ 1

All the time i use break and continue, it shows that "break is outside the funtion" for also "continue" it happens.help plz

y=input() for x in y: if y>=5: print(x) continue if x==4: break print(x) y+=1 print(x) print("finished")

3rd Oct 2020, 1:27 PM
Muhtasinul
Muhtasinul - avatar
1 Answer
+ 1
Is that if belongs to loop? You can use break to exit loop, not used for if exit..! Edit : y=int(input()) for x in range(y): if y>=5: print(x) continue if x==4: break print(x) y+=1 print(x) print("finished")
3rd Oct 2020, 1:41 PM
Jayakrishna 🇼🇳