怎么 利用map()函数,输出列表[1,2,…,100]的阶乘列表?输出结果是[1,2,6,24,120,……]
参考如下:
import math num_list = list(range(1, 101)) factorial_list = list(map(math.factorial, num_list)) print(factorial_list)
效果如下: