break | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

break

When trying the following example in IDLE 3.6.0, I get an error message: i = 0 while 1==1: print(i) i = i + 1 if i >= 5: print("Breaking") break print("Finished") "SyntaxError: multiple statements found while compiling a single statement" WHat do I do wrong?

20th Mar 2017, 11:56 AM
Laszlo Bok
2 Answers
0
You copy: "i=0 while True: etc. " So you have a statement (i=0) followed by another (while True: etc.) and IDLE doesn't like that. You can copy first "i=0" and then the rest of the code
20th Mar 2017, 10:11 PM
Amaras A
Amaras A - avatar
0
Thanks.
21st Mar 2017, 9:38 AM
Laszlo Bok