3 커밋 a9571617a5 ... 6462215537

작성자 SHA1 메시지 날짜
  Adel Qalieh 6462215537 Merge branch 'master' of github.com:adelq/project-euler 5 년 전
  Adel Qalieh c78e2bfc7d Merge branch 'master' of github.com:adelq/project-euler 12 년 전
  Adel Qalieh e9a521d4df Counting Sundays 12 년 전
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      19.py

+ 11 - 0
19.py

@@ -0,0 +1,11 @@
+from datetime import date
+
+sundays = 0
+
+for year in range(1901,2001):   # From 1901 to 2000
+	for month in range(1,13): # Every month
+		# Check if first day of the month is Sunday (6)
+		if date(year, month, 1).weekday() == 6:
+			sundays += 1
+
+print(sundays)