In this Basic Python Program, we will find the factorial of a number.
What is factorial of a number?
In Mathematics, Factorial of a non-negative integer is multiplication of all integers smaller than or equal to n.
Example: factorial of 3 will be 3*2*1, that will be 6.
Python Program To Find The Factorial Of A Number
def factorial_num(n): return 1 if (n==1 or n==0) else n * factorial_num(n - 1); num = 3; print("Factorial of",num,"is", factorial_num(num))
Factorial of 3 is 6