From 95341b61b030c9e1290f3b326cb7ec584f543aea Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Sun, 31 Aug 2014 20:21:45 +0200 Subject: moved files to higher directory after split to new repository --- 019.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 019.py (limited to '019.py') diff --git a/019.py b/019.py new file mode 100644 index 0000000..187b45e --- /dev/null +++ b/019.py @@ -0,0 +1,17 @@ +days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] + +day = 7 # first sunday in 1900 +count = 0 + +for year in range(1900, 2001): + for month in range(1, 13): + if day == 1 and year >= 1901: + count += 1 + if month == 2 and year % 4 == 0: + day -= 1 + while(day <= days[month-1]): + day += 7 + day -= days[month-1] + +print count + -- cgit v1.2.3