Program to print the given series




print("1 + 1/1! + 1/2! + 1/3! +……+ 1/n!")

n=int(input("Enter the value of n: "))

sum = 0


for i in range(n + 1) :

    f = 1

    for j in range(1, i+1) :

        f*=j

    sum = sum+(1/f)


print("Sum of the terms=", sum)





Comments

Popular Posts