Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: please i need explanation

Reply
Thread Tools

Re: please i need explanation

 
 
K. Elo
Guest
Posts: n/a
 
      01-11-2013
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, wrote:
> def factorial(n):
> if n<2:
> return 1
> f = 1
> while n>= 2:
> f *= n
> f -= 1
> return f
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
please i need explanation kwakukwatiah@gmail.com Python 2 01-13-2013 09:08 PM
Re: please i need explanation kwakukwatiah@gmail.com Python 2 01-11-2013 12:58 PM
Re: please i need explanation Karim Python 0 01-11-2013 10:41 AM
Re: please i need explanation Vincent Vande Vyvre Python 0 01-11-2013 10:11 AM
Re: please i need explanation Karim Python 0 01-11-2013 09:59 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57