题目:求1+2!+3!+…+20!的和
分析:用for循环
# -*- coding: utf-8 -*-
#By AntInSnow
a = 1
b = 2
num_sum = 0
for i in range(1,21):
a *= i
num_sum += a
print(num_sum)
题目:求1+2!+3!+…+20!的和
分析:用for循环
# -*- coding: utf-8 -*-
#By AntInSnow
a = 1
b = 2
num_sum = 0
for i in range(1,21):
a *= i
num_sum += a
print(num_sum)