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

10 lines
164 B
Python

def approx_pi(i):
i = 7
i = 16
n = 0
pi = 0
while n <= i :
j = ((-1)**n)/((2*n) +1)
pi += 4*j
n+=1
return pi