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


Groups > comp.lang.python > #29687

Re: Print Function

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: Print Function
Date 2012-09-21 21:17 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <k3ilhp$ckn$1@reader1.panix.com> (permalink)
References <db8c7111-8fc7-4884-8c58-987399f7793f@googlegroups.com>

Show all headers | View raw


In <db8c7111-8fc7-4884-8c58-987399f7793f@googlegroups.com> gengyangcai@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
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

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