Introduction: Factorial Number Code for Python
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
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
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
number1=int(input("Enter number "))
for i in range(number1,0,-1):
result = functools.reduce(operator.mul,multipliers, 1)
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.
Participated in the