[Tutor] New to Python - print function - invalid syntax

Greg Markham greg.markham at gmail.com
Mon Aug 4 19:28:54 CEST 2014


Hello,

I'm extremely new to Python having only just started learning this week.
I'm slowly plodding through a book, Python Programming for the Absolute
Beginner, 3rd ed
<http://www.amazon.com/Python-Programming-Absolute-Beginner-Edition/dp/1435455002/ref=sr_1_5?ie=UTF8&qid=1407049249&sr=8-5&keywords=learning+python>
by Michael Dawson.

Code is provided for all the scripts found throughout the book (found here
<http://www.delmarlearning.com/companions/content/1435455002/downloads/py3e_source.zip>),
but I'm running into a syntax error when running one of the unmodified
programs.  On line 14, which reads:

*print("Here", end=" ")*

I'm receiving a *syntax error* which points to the *end *parameter.  In
order to confirm this, I modified the code to read:

*print("Here ")*

...which runs without incident.  My best guess is that there's a minor
difference between the version of Python I'm using (3.4.1) and that which
was in use at the time the book was written (3.1.x) that is responsible for
this error.

Thanks and my apologies for the "greenness" of this question.

Sincerely,

Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140804/24e38f13/attachment.html>


More information about the Tutor mailing list