"Adding factorials: Given an integer n, print the sum 1!+2!+3!+...+n!." - Snakify python coding question

 

 

 

 


 

CODING QUESTION

Here is question


SOLUTION

sum=0
n=int(input())
for i in range(1,n+1):
    fact=1
    for j in range(1,i+1):
        fact*=j
    sum+=fact
print(sum)

 

Input : 1

Output : 1