Why is Python 3.1 throwing a SyntaxError when printing after loop?
Posted
by bubersson
on Stack Overflow
See other posts from Stack Overflow
or by bubersson
Published on 2010-05-09T10:41:04Z
Indexed on
2010/05/09
10:48 UTC
Read the original article
Hit count: 144
Hi, I'm trying to run this snippet in Python 3.1 console and I'm getting SyntaxError:
>>> while True:
... a=5
... if a<6:
... break
... print("hello")
File "<stdin>", line 5
print("hello")
^
SyntaxError: invalid syntax
>>>
(This is just shortened code to make a point.)
Am I missing something? Is there some other Magic I don't know about? Thanks for your help (since this is my first StackOverflow question and I'm not a native English speaker)
© Stack Overflow or respective owner