📅  最后修改于: 2022-03-11 14:45:12.338000             🧑  作者: Mango
# Recursive Factorial Example
# input: 5
# output: 120 (5*4*3*2*1)
def factorial(x):
if x == 1:
return 1
else:
return (x * factorial(x-1))