44.WAP to display sum of following series(Sum of Factorial Series)

 s=1! + 2! + 3! + 4! + ....

CODE:

sum=0
fact=1
n=int(input("How many terms?\n"))
for i in range(1,n+1):
fact=fact*i
sum=sum+(fact)

print("Sum of series is ",sum)
OUTPUT:
How many terms?
3
Sum of series is  9


 

Comments

Popular posts from this blog