def afeng(x):
if x == 1:
return 1
return x*afeng(x-1)
print(afeng(5))
结果:120
使用递归实现:计算某个数的阶乘
原文:https://www.cnblogs.com/nishoufeng/p/12048956.html