Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: please i need explanation (http://www.velocityreviews.com/forums/t956414-re-please-i-need-explanation.html)

Vincent Vande Vyvre 01-11-2013 10:11 AM

Re: please i need explanation
 
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>


All times are GMT. The time now is 07:52 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.