Skip to content

Instantly share code, notes, and snippets.

@st98
Created December 3, 2013 12:03
Show Gist options
  • Save st98/7768076 to your computer and use it in GitHub Desktop.
Save st98/7768076 to your computer and use it in GitHub Desktop.
階乗を求める関数。
from functools import reduce
from operator import mul
def fact(n):
return reduce(mul, range(1, n + 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment