Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #78568 > unrolled thread
| Started by | Andrew Berg <aberg010@my.hennepintech.edu> |
|---|---|
| First post | 2014-10-01 17:45 -0500 |
| Last post | 2014-10-01 17:45 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Function passed as an argument returns none Andrew Berg <aberg010@my.hennepintech.edu> - 2014-10-01 17:45 -0500
| From | Andrew Berg <aberg010@my.hennepintech.edu> |
|---|---|
| Date | 2014-10-01 17:45 -0500 |
| Subject | Re: Function passed as an argument returns none |
| Message-ID | <mailman.14533.1412203523.18130.python-list@python.org> |
On 2014.10.01 17:37, Shiva wrote:
> Only 'None' gets passed on to parameter 'got' instead of the expected value
> of 4.
> Any idea why 'None' is getting passed even though calling the donuts(4)
> alone returns the expected value?
donuts() prints what you tell it to ("Number of donuts: 5"), and then returns
what you tell it to (nothing).
If you don't explicitly make a function return something, it returns None.
Whatever other logic you have in the function is irrelevant.
Back to top | Article view | comp.lang.python
csiph-web