0
continue statement
can anyone explain to me why should put TRUE ? because when i try write the code by myself it isn't run correctly i = 0 while True: i = i +1 if i == 2: print("Skipping 2") continue if i == 5: print("Breaking") break print(i) print("Finished")
3 Answers
+ 3
It seems correct. Can you show what error do you get?
The expected output is:
1
Skipping 2
3
4
Breaking
Finished
+ 2
In addition to what Abdul rahman said, True is used with while to make an infinite while loop. Since there is a breaking condition so it won't be infinite in this case.
+ 1
thank you guys so much I got it