Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36613 > unrolled thread
| Started by | Vincent Vande Vyvre <vincent.vandevyvre@swing.be> |
|---|---|
| First post | 2013-01-11 11:11 +0100 |
| Last post | 2013-01-11 11:11 +0100 |
| 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: please i need explanation Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2013-01-11 11:11 +0100
| From | Vincent Vande Vyvre <vincent.vandevyvre@swing.be> |
|---|---|
| Date | 2013-01-11 11:11 +0100 |
| Subject | Re: please i need explanation |
| Message-ID | <mailman.392.1357899535.2939.python-list@python.org> |
Le 11/01/13 16:35, kwakukwatiah@gmail.com a écrit :
> def factorial(n):
> if n<2:
> return 1
> f = 1
> while n>= 2:
> f *= n
> f -= 1
> return f
>
>
>
I guess you mean:
f = 1
while n>= 2:
f *= n
n -= 1
return f
Try it.
--
Vincent V.V.
Oqapy <https://launchpad.net/oqapy> . Qarte
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>
Back to top | Article view | comp.lang.python
csiph-web