Discuss / Python / 看大家的回答都会很有启发

看大家的回答都会很有启发

Topic source

def pi(N): L = itertools.count(1, 2) L1 = list(itertools.takewhile(lambda x:x<=(2*N-1), L)) L2 = [4/m*(-1)**n for m,n in zip(L1,range(N))] return sum(L2)


  • 1

Reply