Python Program to Calculate Factorial of a Number



Factorial of an integer is the product of the integer and all the integers below it; e.g. factorial five ( 5! ) is equal to (5*4*3*2*1) =120



  1. #Python Program to calculate factorial of a number
  2. n=int(input("Enter number of rows: "))
  3. fact=1
  4. for i in range(1, n+1):
  5. fact=fact*i
  6. print(fact)

Output


Output!