The Sir Method in Python



It's a method created by Sir Isaac Newton to calculate the number Pi.
See the code:

2*sum([ float(map( lambda n:reduce(lambda a,b:a*(b+1),range(n),1) ,range(0,50))[i]) / map( lambda c: reduce(lambda x,y: x*y ,c) , [range(1,n,2) for n in range(3,101,2)])[i] for i in range(0,33)])

And see a draw
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfn2ZVx9RqRIO9tpKVSy5F6HrHM1cX31oeE8bzaNTkRhiTxrm2z2tG2NMyIMir4q2MN4qnLPl_BzNVheNdSLGyOo70YuBWGVO3NHjvsR2MnPZbyjwlUKK1bU0-gLW5TFkfrKqHlPUkCoo/s1600-h/Newton.png

0 comentários: