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))
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)
In [ ]: