[Edu-sig] Pi Day Fun (3.14, 2016)

Matt Harrison matthewharrison at gmail.com
Mon Mar 14 20:21:14 EDT 2016


Here's my "modern" python one-liner for today:

print sum(4./num if i % 2 == 0 else -4./num for i, num in
enumerate(range(1, 100000, 2)))

Cheers,

Matt

On Mon, Mar 14, 2016 at 4:19 PM, kirby urner <kirby.urner at gmail.com> wrote:

>
> http://nbviewer.jupyter.org/github/4dsolutions/Python5/blob/master/Pi%20Day%20Fun.ipynb
>
> The above URL renders a Github-saved public I-Python Notebook using
> nbviewer, a utility for rendering any Jupyter notebook with a public URL.
>
> My example Python code is generator-centric as successive approximations
> of something, approaching a limit, lends itself to such yield-based
> treatment.
>
> Kirby
>
>
>
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> https://mail.python.org/mailman/listinfo/edu-sig
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20160314/593f44d2/attachment.html>


More information about the Edu-sig mailing list