Print Function

G

gengyangcai

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
 
T

Tarek Ziadé

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:
Game Over
 
J

John Gordon

In said:
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 .

In python version 3, print was changed into a function.

Use this and it will work:

print("Game Over")
 
I

Ian Kelly

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.
 
S

Steven D'Aprano

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,
 
M

Mark Lawrence

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,

+ one trillion
 
W

Walter Hurry

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,

I think OP rather gave the game away with the subject line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top