aboutsummaryrefslogtreecommitdiff
path: root/challenge-227/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-227/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-227/eric-cheung/python/ch-1.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-227/eric-cheung/python/ch-1.py b/challenge-227/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..1286f37671
--- /dev/null
+++ b/challenge-227/eric-cheung/python/ch-1.py
@@ -0,0 +1,13 @@
+
+from datetime import datetime
+
+nYearGiven = 2023 ## Example
+
+nFri_13th_Count = len([nMonthLoop + 1 for nMonthLoop in range(12) if int(datetime(nYearGiven, nMonthLoop + 1, 13).strftime("%w")) == 5])
+
+## for nMonthLoop in range(12):
+ ## strWeekDay = datetime(nYearGiven, nMonthLoop + 1, 13).strftime("%w")
+ ## if int(strWeekDay) == 5:
+ ## nFri_13th_Count = nFri_13th_Count + 1
+
+print (nFri_13th_Count)