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/t956412-re-please-i-need-explanation.html)

K. Elo 01-11-2013 09:56 AM

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




All times are GMT. The time now is 01:25 PM.

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