write a program to calculate factorial of any number entered by the user in python. this is very important who knows answer then only reply I have to submit
Answers
Answered by
1
def calc_factorial(n):
if n == 0 or n == 1:
return 1
factorial = 1
for i in range(1, n + 1):
factorial *= i
return factorial
n = int(input("enter num: "))
print(f"factorial: {calc_factorial(n)}")
Similar questions