Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Print Function

70 views
Skip to first unread message

gengy...@gmail.com

unread,
Sep 21, 2012, 4:20:09 PM9/21/12
to
Hello ,


I am currently using Python 3.2.3 . WHen I use the print function by typing print "Game Over" , it mentions " SyntaxError : invalid syntax ". Any ideas on what the problem is and how to resolve it ? Thanks a lot .


GengYang

Rodrick Brown

unread,
Sep 21, 2012, 4:28:19 PM9/21/12
to gengy...@gmail.com, pytho...@python.org
Go away troll!

Sent from my iPhone

On Sep 21, 2012, at 4:27 PM, "gengy...@gmail.com"
> --
> http://mail.python.org/mailman/listinfo/python-list

Tarek Ziadé

unread,
Sep 21, 2012, 4:29:55 PM9/21/12
to pytho...@python.org
On 9/21/12 10:20 PM, gengy...@gmail.com wrote:
> Hello ,
>
>
> I am currently using Python 3.2.3 . WHen I use the print function by typing print "Game Over" , it mentions " SyntaxError : invalid syntax ". Any ideas on what the problem is and how to resolve it ? Thanks a lot .

print was a statement in python 2.x, it is now a function so you need
parenthesis:

>>> print("Game Over")
Game Over

>
>
> GengYang

Ian Kelly

unread,
Sep 21, 2012, 4:54:14 PM9/21/12
to Python
On Fri, Sep 21, 2012 at 2:28 PM, Rodrick Brown <rodric...@gmail.com> wrote:
> Go away troll!

Troll? It looked like a sincere question to me.

Alister

unread,
Sep 21, 2012, 5:11:29 PM9/21/12
to
but one that page 1 of the documentation would answer.



--
Waste not, get your budget cut next year.

John Gordon

unread,
Sep 21, 2012, 5:17:45 PM9/21/12
to
In python version 3, print was changed into a function.

Use this and it will work:

print("Game Over")

--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

Ian Kelly

unread,
Sep 21, 2012, 6:43:05 PM9/21/12
to Python
On Fri, Sep 21, 2012 at 3:11 PM, Alister <aliste...@ntlworld.com> wrote:
> On Fri, 21 Sep 2012 14:54:14 -0600, Ian Kelly wrote:
>
>> On Fri, Sep 21, 2012 at 2:28 PM, Rodrick Brown <rodric...@gmail.com>
>> wrote:
>>> Go away troll!
>>
>> Troll? It looked like a sincere question to me.
>
> but one that page 1 of the documentation would answer.

So point the asker to the documentation, don't just dismiss them as a troll.

This newsgroup has a reputation for being friendly. Let's keep it that way.

Steven D'Aprano

unread,
Sep 21, 2012, 9:26:43 PM9/21/12
to
On Fri, 21 Sep 2012 13:20:09 -0700, gengyangcai wrote:

> I am currently using Python 3.2.3 . WHen I use the print function by
> typing print "Game Over" , it mentions " SyntaxError : invalid syntax
> ". Any ideas on what the problem is and how to resolve it ?

No, none what so ever. Perhaps you are the first person in the world to
have come across this error. If you ever solve it, please write up the
solution and put it on a blog or a website somewhere so that if it ever
happens again, googling for "python print SyntaxError" will return a
useful result.

Tongue-firmly-in-cheek-ly y'rs,


--
Steven

Mark Lawrence

unread,
Sep 22, 2012, 3:27:32 AM9/22/12
to pytho...@python.org
+ one trillion

--
Cheers.

Mark Lawrence.

Walter Hurry

unread,
Sep 22, 2012, 7:28:10 PM9/22/12
to
I think OP rather gave the game away with the subject line.
0 new messages