写的和c似的。。。
def pi(N): odd = itertools.count(1, 2) sum = 0 count = 0 for n in odd: sum += ((-1)**count)*4/n count += 1 if count >= N: break return sum
Sign in to make a reply
明天过后.
写的和c似的。。。