Ali Polatel wrote:
dear friends ,
I found a code which calculates pi with an interesting algorithm
the programme code is below:
from sys import stdout
def f((q,r,t,k)):
n = (3*q+r) / t
if (4*q+r) / t == n:
return (10*q,10*(r-n*t),t,k,n)
else:
return (q*k, q*
This code gives the number in an unusual format like "3.1415'None'"
it has a number part and a string part . I want to seperate these from
easc other but I couldn't manage. I mean when I try to turn it into
string format then try to use things like [:4] or like that they don't
work.Any idea ho
dear friends ,
I found a code which calculates pi with an interesting algorithm the programme code is below:
from sys import stdout
def f((q,r,t,k)): n = (3*q+r) / t if (4*q+r) / t == n: return (10*q,10*(r-n*t),t,k,n) else: return (q*k, q*(4*k+2)+r*(2*k+1),t*(2*k+1),k+1)
# Ca