linfo2335-programming-parad.../project-3/regex/code/code1837.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_2)/((2*var_2)+1)
sum=4*sum
return sum