@@ -0,0 +1,1067 @@
+%22%22%22%0A1 Jan 1900 was a Monday.%0AThirty days has September, April, June and November.%0AAll the rest have thirty-one, %0ASaving February alone, Which has twenty-eight, rain or shine.%0AAnd on leap years, twenty-nine.%0AA leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400.%0A%0AHow many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?%0A%22%22%22%0A%0A%0Adef days_in(year, month):%0A    if month == 4 or month == 6 or month == 9 or month == 11:%0A        return 30%0A    elif month == 2:%0A        if year %25 4 == 0:%0A            return 29%0A        else:%0A            return 28%0A    else:%0A        return 31 %0A%0Adef is_sunday(days_post_jan_1_1901):%0A    # 1st sunday in 1901 is Jan 6%0A    return days_post_jan_1_1901 %25 7 == 6%0A%0Adef sunday_as_first_of_month_from_1901_2000():%0A    total_days = 1%0A    sundays = 0%0A    for year in xrange(1901, 2001):%0A        for month in xrange(1, 13):%0A            total_days += days_in(year, month)%0A            if is_sunday(total_days):%0A                sundays +=1%0A%0A    return sundays%0A

Solving p019