Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36611
| Date | 2013-01-11 11:56 +0200 |
|---|---|
| From | "K. Elo" <maillists@nic.fi> |
| Subject | Re: please i need explanation |
| References | <2FB5A66FD91D456BBDFCC0AE25760392@favour> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.390.1357898558.2939.python-list@python.org> (permalink) |
Hi! Since there is no stated question, I need to guess: n -= 1 (instead of "f -= 1") should work. Or maybe the question was a totally different one... -Kimmo 11.01.2013 17:35, kwakukwatiah@gmail.com wrote: > def factorial(n): > if n<2: > return 1 > f = 1 > while n>= 2: > f *= n > f -= 1 > return f > > >
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: please i need explanation "K. Elo" <maillists@nic.fi> - 2013-01-11 11:56 +0200
csiph-web