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

6 lines
145 B
Python

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