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 .
> 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 .
> 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:
On Fri, 21 Sep 2012 14:54:14 -0600, Ian Kelly wrote:
> On Fri, Sep 21, 2012 at 2:28 PM, Rodrick Brown <rodrick.br...@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.
In <db8c7111-8fc7-4884-8c58-987399f7793f@googlegroups.com> gengyang...@gmail.com writes:
> 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")
-- 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"
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.
> 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.
On Sat, 22 Sep 2012 01:26:43 +0000, Steven D'Aprano wrote:
> 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,
I think OP rather gave the game away with the subject line.