Untitled
unknown
plain_text
2 years ago
230 B
9
Indexable
def factorial(n):
if n == 0 or n == 1:
return 1
else:
return n * factorial(n - 1)
# Example: Calculate factorial of 5
number = 5
result = factorial(number)
print(f"The factorial of {number} is: {result}")
Editor is loading...
Leave a Comment