[Tutor] Problem with print
David Hutto
smokefloat at gmail.com
Sun Dec 19 22:41:32 CET 2010
On Sun, Dec 19, 2010 at 4:33 PM, Hugo Arts <hugo.yoshi at gmail.com> wrote:
> On Sun, Dec 19, 2010 at 10:11 PM, Sander Sweers <sander.sweers at gmail.com> wrote:
>> On 19 December 2010 21:54, jtl999 <jacksmoo111 at gmail.com> wrote:
>>> File "GettingStarted.py", line 91
>>> print ("Lesson Two")
>>> ^
>>> SyntaxError: invalid syntax
>>>
>>> Python 2.6.5
>>
>> You are using a howto for python version 3.X but you are using python
>> 2.X. In python 3 the print statement was changed to a function.
>>
>> Python 2.X
>> print "Lesson Two"
>>
>> Python 3.X
>> print("Lesson Two")
>>
>> Either find a version of the howto for 2 or install python 3.
>>
>
> Alex is right, David and Sander judged too quickly:
>
> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> print("Lesson Two")
> Lesson Two
>>>> print("a", "b")
> ('a', 'b')
>
> Note the python version? It works. The parentheses are just
> parentheses, not a function call. But it still works. The actual error
> is likely on the line before the print statement.
>
Apparently so, but I'd like to see the full code to know what caused
the error to point to print.
http://www.google.com/search?client=ubuntu&channel=fs&q=python+print+syntax+error&ie=utf-8&oe=utf-8
> Hugo
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
They're installing the breathalyzer on my email account next week.
More information about the Tutor
mailing list