please i need explanation

Hans Mulder hansmu at xs4all.nl
Fri Jan 11 18:56:02 EST 2013


On 11/01/13 16:35:10, kwakukwatiah at gmail.com wrote:
> def factorial(n):
>     if n<2:
>              return 1
>     f = 1
>     while n>= 2:
>         f *= n
>         f -= 1

U think this line should have been:

          n -= 1

>     return f


Hope this helps,

-- HansM



More information about the Python-list mailing list