linfo2335-programming-parad.../project-3/regex/code/code1453.py

7 lines
160 B
Python

def approx_pi(var_1):
sum=0
for var_2 in range (0,var_1+1):
sum+=((-1)**var_2)/((2*var_2)+1)
sum=4*sum
return sum
print(sum)