Introduction: Factorial Number Code for Python

About: Aspiring software engineer, tinkerer, geek

Factorial numbers are clever
Factorial numbers look like this 5!
The exclamation mark means to multiply the number before it with all the numbers after it. For example... 5!=5x4x3x2x1 the answer is 120
With Python I managed to program the function from scratch

Step 1: Before You Start

This program can come in use in mathematics because most calculator can't calculate bigger numbers because of its computing power.
Before you begin you need to install Python 3.4.3 from the Python website

(But for the attached file you need to use 2.7.3)

Step 2: The Code

while True:
number1=int(input("Enter number "))
number2=number1+1
multipliers=list()
for i in range(number1,0,-1):
multipliers.append(i)
#print(i)
import operator
import functools
result = functools.reduce(operator.mul,multipliers, 1)
print(result)

Step 3: Files

Factorial Number.py is the program, so if you don't want to code it yourself then download it, open python and then open the file and run[f5].

100000! is a extremely big factorial number if you want to have a look at what this program can do.

Step 4: Final Thing

One last thing this program take a long time to calculate large numbers so I wouldn't recommend inputting ridiculously large numbers.

Have Fun!

InventoYoda

Automation Contest

Participated in the
Automation Contest