[Tutor] print 'hello world' - invalid syntax

Mark Lawrence breamoreboy at yahoo.co.uk
Sun May 20 20:20:32 CEST 2012


On 20/05/2012 19:08, Quidam S-enfuit 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 error!?...
> Thanks.
> =======copied from python (interactive command) /pasted below==================
> Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win
>
> 32
>
> Type "help", "copyright", "credits" or "license" for more information.
>
>>>> print 'hello world'
>
>    File "<stdin>", line 1
>
>      print 'hello world'
>
>                        ^
>
> SyntaxError: invalid syntax
>
>
> ==============================end====================================
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

Print is a function in Python 3, so you need print('hello world').

-- 
Cheers.

Mark Lawrence.



More information about the Tutor mailing list