有帮助望采纳
import math a = eval(input('请输入n:\n')) sum = 0 for i in range(1, a+1): sum += math.factorial(i) print(sum)
?题呢