In [4]:
def product(end):
    i=1
    total=1
    while i<end:
        i=i+1
        total=total*i
    return total
m=int(input('first'))
n=int(input('second'))
k=int(input('third'))
print('sum:', product(m)+product(n)+product(k))


first3
second33
third3
sum: 8683317618811886495518194401280000012

In [6]:
def product(n):
    i = 0
    k = 1
    total = 0
    while (k <= n):
        i = (k*2)-1
        if (k % 2) == 0:
            total -= (1/i)
        else:
            total += (1/i)
        k += 1
    return total
n = int(input())
print(product(n)*4)


100000
3.1415826535897198

In [ ]: