Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Print Function

Reply
Thread Tools

Print Function

 
 
gengyangcai@gmail.com
Guest
Posts: n/a
 
      09-21-2012
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
 
Reply With Quote
 
 
 
 
Rodrick Brown
Guest
Posts: n/a
 
      09-21-2012
Go away troll!

Sent from my iPhone

On Sep 21, 2012, at 4:27 PM, "(E-Mail Removed)"
<(E-Mail Removed)> 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 .
>
>
> GengYang
> --
> http://mail.python.org/mailman/listinfo/python-list

 
Reply With Quote
 
 
 
 
Tarek Ziadé
Guest
Posts: n/a
 
      09-21-2012
On 9/21/12 10:20 PM, http://www.velocityreviews.com/forums/(E-Mail Removed) 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


 
Reply With Quote
 
Ian Kelly
Guest
Posts: n/a
 
      09-21-2012
On Fri, Sep 21, 2012 at 2:28 PM, Rodrick Brown <(E-Mail Removed)> wrote:
> Go away troll!


Troll? It looked like a sincere question to me.
 
Reply With Quote
 
John Gordon
Guest
Posts: n/a
 
      09-21-2012
In <(E-Mail Removed)> (E-Mail Removed) 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
(E-Mail Removed) B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

 
Reply With Quote
 
Ian Kelly
Guest
Posts: n/a
 
      09-21-2012
On Fri, Sep 21, 2012 at 3:11 PM, Alister <(E-Mail Removed)> wrote:
> On Fri, 21 Sep 2012 14:54:14 -0600, Ian Kelly wrote:
>
>> On Fri, Sep 21, 2012 at 2:28 PM, Rodrick Brown <(E-Mail Removed)>
>> 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.
 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      09-22-2012
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
 
Reply With Quote
 
Mark Lawrence
Guest
Posts: n/a
 
      09-22-2012
On 22/09/2012 02:26, 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,
>
>


+ one trillion

--
Cheers.

Mark Lawrence.

 
Reply With Quote
 
Walter Hurry
Guest
Posts: n/a
 
      09-22-2012
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
Print function name of calling function? dspfun C Programming 15 02-21-2007 03:23 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments