view problem19.py @ 14:49c96972949d default tip

#50 rewrite of solution
author Dominic Cleal <dominic@computerkb.co.uk>
date Mon, 01 Dec 2008 19:11:55 +0000
parents 0e08f4decf67
children
line wrap: on
line source

import datetime

t = 0
d = datetime.date(1901, 1, 1)
for y in range(1901, 2001):
	d = d.replace(year=y)
	for m in range(1, 13):
		d = d.replace(month=m)
		if d.isoweekday() == 7:
			t += 1
print t