8 lines
150 B
Python
8 lines
150 B
Python
|
def approx_pi(i):
|
||
|
i = 3
|
||
|
sum=0
|
||
|
for x in range (0,i+1):
|
||
|
sum+=((-1)**x)/((2*x)+1)
|
||
|
sum=4*sum
|
||
|
print(sum)
|
||
|
return sum
|