How a geek handles pregnancy

#!/usr/bin/env python 

from datetime import date, timedelta

conception_date = date(year=2008, month=11, day=2)
today = date.today()
babys_age = today - conception_date

print "Baby's age"
print "    from conception"
print "        in days: %d" % babys_age.days
print "        in weeks: %.2f" % round(babys_age.days / 7.0, 2)

babys_age += timedelta(14)

print "    from LMP"
print "        in days: %d" % babys_age.days
print "        in weeks: %.2f" % round(babys_age.days / 7.0, 2)

Leave a Reply

Your email address will not be published. Required fields are marked *