[Tutor] print 'hello world' - invalid syntax
robertvstepp at gmail.com
Sun May 20 20:16:47 CEST 2012
On Sun, May 20, 2012 at 1:08 PM, Quidam S-enfuit
<quidam_senfuit at yahoo.com> wrote:
> I have installed python on the windows 7 machine. (Tried 64 bit version
> also; same error).
> I tried print "Hello world" and print 'hello world'. It stated syntax
> =======copied from python (interactive command) /pasted
> Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)]
> on win
> Type "help", "copyright", "credits" or "license" for more information.
> >>> print 'hello world'
> File "<stdin>", line 1
> print 'hello world'
> SyntaxError: invalid syntax
I am starting to learn Python as well. Apparently one of the
significant changes from Python 2.x versions to the new Python 3.x
versions is that print is now treated as a function. So instead try:
I think that should work for your version of Python.
More information about the Tutor