Create a function factorial (x) that takes an integer and returns the product of all the positive
integers less than or equalton.
Answers
Answered by
1
def factorial(n):
product = 1
for x in range(1, n + 1):
product *= x
return product
n = int(input("enter n: "))
print(factorial(n))
Similar questions