Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Built in factorial function Python
05-16-2010, 01:10 AM
Post: #1
Built in factorial function Python
Python has a built-in factorial function in the math module. Here is an example on how to use it.

Code:
#This example was coded by codecaine aka Jerome Scott II

import math #imports the math module
print(math.factorial(10)) #prints the factorial of 10
Visit this user's website Find all posts by this user
Quote this message in a reply
05-16-2010, 01:13 AM
Post: #2
RE: Built in factorial function Python
Very good ! It must have recursive algorithm under the hood.

There's a fine line between genius and insanity. I have erased this line.
Oscar Levant
There's a fine line between an administrator and black hat hacker. I have erased this line.
Dr DEBCOL
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: