n = int(input('Enter an integer >= 0:'))
fact = 0
for i in range(1,n):
fact = fact * n
print('factorial is' fact)
Answers
Answered by
3
Answer:
def factorial(n):
factorial = 1
if n == 0:
return factorial
for i in range(1, n + 1):
factorial *= i
return factorial
print("factorial is", factorial((n := int(input("Enter an integer >= 0: ")))))
Similar questions