Created by varsha
“If this program turns out helpful to you please let me know in
the comments.”
What you should know?
Concept of factorials
If else concept
Basic knowledge of python code
Factorials: Concept
 The factorial of a positive number is the product of all
numbers less than or equal to it. So…
1! = 1
2! = 1 x 2
3! = 1 x 2 x 3
4! = 1 x 2 x 3 x 4
....
100! = 1 x 2 x 3 x 4 .... 100
Python code for factorial of a no:
Notes about code:
 “Number” is my variable for storing user’s value.
 Similarly “factorial” is also a variable
 Nested if condition is used to save time
 For condition is similar to the code in C or C++ for
factorial i.e. its easy
 In the end you get a pyramid cause computer prints all
the trials and the bottom one is the answer.
Results:

Factorial of a number in python

  • 1.
    Created by varsha “Ifthis program turns out helpful to you please let me know in the comments.”
  • 2.
    What you shouldknow? Concept of factorials If else concept Basic knowledge of python code
  • 3.
    Factorials: Concept  Thefactorial of a positive number is the product of all numbers less than or equal to it. So… 1! = 1 2! = 1 x 2 3! = 1 x 2 x 3 4! = 1 x 2 x 3 x 4 .... 100! = 1 x 2 x 3 x 4 .... 100
  • 4.
    Python code forfactorial of a no:
  • 5.
    Notes about code: “Number” is my variable for storing user’s value.  Similarly “factorial” is also a variable  Nested if condition is used to save time  For condition is similar to the code in C or C++ for factorial i.e. its easy  In the end you get a pyramid cause computer prints all the trials and the bottom one is the answer.
  • 6.