Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29679

Re: Print Function

Date 2012-09-21 22:29 +0200
From Tarek Ziadé <tarek@ziade.org>
Subject Re: Print Function
References <db8c7111-8fc7-4884-8c58-987399f7793f@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1038.1348259365.27098.python-list@python.org> (permalink)

Show all headers | View raw


On 9/21/12 10:20 PM, gengyangcai@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Print Function gengyangcai@gmail.com - 2012-09-21 13:20 -0700
  Re: Print Function Rodrick Brown <rodrick.brown@gmail.com> - 2012-09-21 16:28 -0400
  Re: Print Function Tarek Ziadé <tarek@ziade.org> - 2012-09-21 22:29 +0200
  Re: Print Function Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-21 14:54 -0600
    Re: Print Function Alister <alister.ware@ntlworld.com> - 2012-09-21 21:11 +0000
      Re: Print Function Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-21 16:43 -0600
  Re: Print Function John Gordon <gordon@panix.com> - 2012-09-21 21:17 +0000
  Re: Print Function Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-22 01:26 +0000
    Re: Print Function Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-22 08:27 +0100
    Re: Print Function Walter Hurry <walterhurry@lavabit.com> - 2012-09-22 23:28 +0000

csiph-web