最后一行往左缩进:(如果帮助到你,请点击一下采纳谢谢)
n=0 s=0 t=1 for n in range(1,6): t *= n s += t print('1!+2!+3!+4!+5!=%d'%s)