Invalid syntax with print "Hello World"

steven.oldner steven.oldner at gmail.com
Thu Mar 12 07:21:46 EDT 2009


On Mar 12, 2:25 am, John Machin <sjmac... at lexicon.net> wrote:
> On Mar 12, 5:57 pm, Henrik Bechmann <hbechm... at gmail.com> wrote:
>
> > obviously total mewbiew:
>
> > My first program in Python Windows
>
> What is that you are callind "Python Windows"? What version of Python
> are you running?
>
> 2.X: print "Hello World"
> should work.
>
> 3.X: print is now a function,
> print("Hello World")
> should work.
>
> If that gets you going: read the tutorial that belongs to the version
> of Python that you are using.
> If it doesn't, come back here with a bit more detail.
>
> BTW, don't indent your first line. Make sure it starts in column 1.
>
> HTH,
> John
>
>
>
>
>
> > print "Hello World"
>
> > I select Run/Run Module and get an error:
>
> > Syntax error, with the closing quote highlighted.
>
> > Tried with single quotes as well. Same problem.
>
> > Can someone explain my mistake?
>
> > Thanks,
>
> > - Henrik- Hide quoted text -
>
> - Show quoted text -

Henrik,

Welcome to the list.  As a newbie myself, I ran into the Python3 vrs
2.6 issue.  May I suggest starting with 2.6?  There is many more books
and internet stuff you can learn with in 2.6 - and the examples will
work. As Garry wrote, once you understand 2.6, 3.0 will not be a
challenge.

Steve Oldner



More information about the Python-list mailing list