## Factorial and Log Factorial

Factorial: When you need to calculate n!, you have several solutions. The "rush" solution: using a loop or a recursive function: def factorial_for(n): r = 1 for i in range(2, n + 1): r *= i return(r) def factorial_rec(n): if n > 1: return(n * factorial_rec(n - 1)) else: return(1) Here, the multiplication of the numbers sequentially will create a huge number very quickly. This is good, but computers are faster when 2 small numbers (120x30240) are involved in a multiplication versus the [...]

## Recent comments