E
fact = lambda n: n*fact(n-1)
🌚🌚🌚
Size: a a a
E
fact = lambda n: n*fact(n-1)
BA
from functools import reduce
from operator import mul
def factorial(n:int):
if n<1: raise ValueError("n must be greater or equal 1")
elif not isinstance(n,int):
raise TypeError("n must be int, not {}".format(type(n)))
return reduce(mul, range(1,n))
БГ
КБ
from functools import reduce
from operator import mul
def factorial(n:int):
if n<1: raise ValueError("n must be greater or equal 1")
elif not isinstance(n,int):
raise TypeError("n must be int, not {}".format(type(n)))
return reduce(mul, range(1,n))
КБ
E
БГ
E
БГ
КБ
s
`
proxies = {БГ
from math import factorial
BA
E
from math import factorial
БГ
py3
from math import factorial
help(factorial)
Help on built-in function factorial in module math:
factorial(...)
factorial(x) -> Integral
Find x!. Raise a ValueError if x is negative or non-integral.
E
py3
from math import factorial
help(factorial)
Help on built-in function factorial in module math:
factorial(...)
factorial(x) -> Integral
Find x!. Raise a ValueError if x is negative or non-integral.
~&
КБ
~&
БГ