Pi Day

13 thoughts
last posted July 23, 2014, 9:07 p.m.

8 earlier thoughts

0

Inspired by Colin Wright, here's a Python list comprehension working out the top 10 date approximations:

from math import pi

print [i[1] for i in sorted([ (abs(pi - (day + 1.) / (month + 1)), "{}/{}".format(day + 1, month + 1)) for month in range(12) for day in range([31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]) ])[:10]]

4 later thoughts