标签:array tar factorial lam nbsp turn factor rom rate
from functools import reduce
import time
def factorial_array(n)
number=reduce(lambda x,y:x*y,range(1,n+1))
return number
print( factorial_array(101)
def calaulate_time(func):
start_time=time.time()
func()
end_time=time.time()
return end_time-start_time
print(calaulate_time(factorate_array(101))
python:practice decorator calaulate_time
标签:array tar factorial lam nbsp turn factor rom rate
原文地址:https://www.cnblogs.com/alansuny/p/12499619.html