#s=1!+2!+3!+…..+n! from functools import reduce def factorial(n): result=0 for i in range(1,n+1): result+=reduce(lambda x,y:x*y,list(range(1,i+1))) print('%s的阶乘加和结果为:%s'%(i,reduce(lambda x,y:x*y,list(range(1,i+1))))) return result print('1到%s的阶乘加和结果是