[Tutor] Help with exercises from learning to program pythonwikibooks

Alan Gauld alan.gauld at btinternet.com
Sun Jul 4 16:14:09 CEST 2010


"John Palmer" <speederpython at gmail.com> wrote

> I've looked at the solution but it appears not to be working when i 
> use this
> code

> File "hello.py", line 1
>    print ("Hello, ", end=" " )
>                         ^
> SyntaxError: invalid syntax

This is Python V3 syntax, I suspect you have Python v2 installed.
This is not necessarily a bad thing since Python v3 is very new
and many applicationsd still require v2. But if you are learning
then you need to match your tutorial to the python version or vice
versa. So either find a Python v2 tutorial or upgrade Python to v3.1.
Until recently I'd have said go with v2 but I think v3 is becoming
sufficiently mature that I'd now suggest upgrading. By the time
you are fluent the external libraries etc should have mostly
caught up.

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list