On Sun, Jul 4, 2010 at 3:20 PM, John Palmer <speederpyt...@gmail.com> wrote: > Hi > > I've just decided to try an learn python but i'm already stuck on one of the > first exercises, i've given the link below: > > http://en.wikibooks.org/wiki/Python_Programming/Creating_Python_programs > > The exercise that i'm stuck on is number three: > > I've looked at the solution but it appears not to be working when i use this > code > > print ("Hello, ", end=" " ) > > print ("world!") > > I get the following error: > > File "hello.py", line 1 > print ("Hello, ", end=" " ) > ^ > SyntaxError: invalid syntax > > > > I've tried every changing where the white space is and the commas but i just > cant get it to work. >
Check your python version (type "python --version" on the command line). This tutorial was made for versions 3.0 and later, and the error suggest you have an older version than that. Some rather big changes happened around the 3.0 release. It should work if you replace the program with this: print "hello", "world!" But I recommend you get a tutorial that matches your python version (or vice versa). Things will be very confusing if you don't Hugo _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor