aboutsummaryrefslogtreecommitdiff
path: root/challenge-227/sgreen/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-227/sgreen/python/ch-1.py')
-rwxr-xr-xchallenge-227/sgreen/python/ch-1.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/challenge-227/sgreen/python/ch-1.py b/challenge-227/sgreen/python/ch-1.py
new file mode 100755
index 0000000000..33aefcf418
--- /dev/null
+++ b/challenge-227/sgreen/python/ch-1.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+import sys
+from datetime import date
+
+
+def main(year):
+ fridays = 0
+ for month in range(1, 13):
+ if date(year, month, 13).isoweekday() == 5:
+ fridays += 1
+
+ print(fridays)
+
+
+if __name__ == '__main__':
+ main(int(sys.argv[1]))