まぬねこの足跡。。。

備忘録+たのしさ+ひっそりと

Python - math.factorial(n):階乗

概要

math.factorial(n)

   n! n=int

  • nの階乗を返す。
  • mathモジュール

インポート

import math

実行結果

import math
print(math.factorial(5))

表示イメージ

120