New to python, can i ask for a little help?

Chris Rebert clp2 at rebertia.com
Wed May 13 06:27:05 CEST 2009


On Tue, May 12, 2009 at 9:18 PM, warhammer1805 at gmail.com
<warhammer1805 at gmail.com> wrote:
> I loaded python 3.1
> I can use the gui and i see the following:
>
> Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
>>>>
>
> It would seem that this is working correctly and there is no path
> problem.
> I am running windows vista.
>
> When i put in a test string i see this:
>
> Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
>>>> print "hello world!"
> SyntaxError: invalid syntax (<pyshell#0>, line 1)
>>>>
>
> Can anyone tell me what is wrong? I didnt expect that error....

The print-statement was removed in Python 3.0. Now it's just a
function. You'll have to use:

print("hello world!")

instead.

Please also read the 3.0 transition docs:
http://docs.python.org/3.0/whatsnew/3.0.html
Note that Python 3.0 differs significantly from Python 2.x

Cheers,
Chris
-- 
http://blog.rebertia.com



More information about the Python-list mailing list