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


Groups > comp.lang.python > #97971

Re: None returned

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: None returned
Date 2015-10-27 15:02 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <n0o3n3$s3n$1@reader1.panix.com> (permalink)
References <b5e68b04-142f-4b78-89ee-874281914d5b@googlegroups.com>

Show all headers | View raw


In <b5e68b04-142f-4b78-89ee-874281914d5b@googlegroups.com> pip7kids@gmail.com writes:

> print(rectangle.describe("this is a new rectangle"))

You're printing the result of describe().

>     def describe(self,text):
>         self.description = text

describe() has no return value, so it returns None by default.

If you want it to return something, make it do that.

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

None returned pip7kids@gmail.com - 2015-10-27 03:49 -0700
  Re: None returned cassiobotaro@gmail.com - 2015-10-27 04:08 -0700
  Re: None returned John Gordon <gordon@panix.com> - 2015-10-27 15:02 +0000
  Re: None returned Larry Hudson <orgnut@yahoo.com> - 2015-10-28 00:23 -0700
  Re: None returned Denis McMahon <denismfmcmahon@gmail.com> - 2015-10-28 08:33 +0000

csiph-web