Skip to content Skip to sidebar Skip to footer

Break Is Outside The Loop Python

while True: x = raw_input() if x =='personal information': print' Edward , Height: 5,10 , EYES: brown , STATE: IL TOWN: , SS:' elif x =='journal': n

Solution 1:

Yes, look at your post. Your else probably is meant to go with the if statement's indentation level.

else statements for while statements do entirely different things.


Solution 2:

No it is not an identation error. You normally "break" out of the loop. The else part in the while statement is not a loop construct. You will find the same error if you do

In [12]: if True:
   ....:    break

SyntaxError: 'break' outside loop

Post a Comment for "Break Is Outside The Loop Python"