2022-01-13 python 再帰呼出し n*fact(n-1) python pythonの再帰呼出しにより階乗 n! の計算が可能になります。 factorialコード def fact(n): if (n <= 1): return 1 else: return n * fact(n - 1) print(fact(5)) Output >> 120