[Tutor] PYTHON 3.1

James Reynolds eire1130 at gmail.com
Tue May 18 15:02:46 CEST 2010


On Tue, May 18, 2010 at 8:40 AM, Dipo Elegbede <delegbede at dudupay.com>wrote:

> Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
> >>> print 'hello'
> SyntaxError: invalid syntax (<pyshell#0>, line 1)
> >>> print ('hello')
> hello
> >>>
>
> the above print is what i came across having installed python 3.0 and
> trying to run the print command.
> with previous versions, a print command takes the form
> print 'parameter'
> and the output is
> parameter
>
> but with this new version it seems you need to put in brackets like:
> print ('hello')
> to get an output like:
> hello
>
> please confirm this is a new syntax for print.
> thank you.
>
> i will put up morte concerns as they arrive.
>
> thanks.
> --
> Elegbede Muhammed Oladipupo
> OCA
> +2348077682428
> +2347042171716
> www.dudupay.com
> Mobile Banking Solutions | Transaction Processing | Enterprise Application
> Development
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>

In python 3K print is a function.

So, print('hello, world') is the correct syntax.

You may find this article helpful:
http://docs.python.org/py3k/whatsnew/3.0.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100518/bd319433/attachment.html>


More information about the Tutor mailing list