please i need explanation

kwakukwatiah at gmail.com kwakukwatiah at gmail.com
Fri Jan 11 11:33:36 EST 2013



-----Original Message----- 
From: K. Elo
Sent: Friday, January 11, 2013 3:56 AM
To: python-list at python.org
Subject: 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 at gmail.com wrote:
> def factorial(n):
>      if n<2:
>               return 1
>      f = 1
>      while n>= 2:
>          f *= n
>          f -= 1
>      return f
>
>
>
please it works.but don’t get why the return 1 and the code below.




More information about the Python-list mailing list