Syntax problem - cannot solve it by myself

Gabriele Lanaro gabriele.lanaro at gmail.com
Tue Jun 8 17:50:58 EDT 2010


The print function you're trying to use is for python 3 version only, If you
want to keep reading the book, install python 3, else take a book that
covers python 2.x syntax

2010/6/8 Deadly Dirk <dirk at plfn.invalid>

> I am a total beginner with Python. I am reading a book ("The Quick Python
> Book", 2nd edition, by Vernon Ceder) which tells me that print function
> takes end="" argument not to print newline character. I tried and here is
> what happens:
>
> >>> print(x)
> abc
> >>> print(x,end="")
>  File "<stdin>", line 1
>    print(x,end="")
>               ^
> SyntaxError: invalid syntax
> >>>
>
> What does the error message mean? I am using Python 2.6.5 on Ubuntu 9.10.
>
>
> --
> The missionaries go forth to Christianize the savages -
> as if the savages weren't dangerous enough already.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100608/ed5bcd1e/attachment-0001.html>


More information about the Python-list mailing list