diff options
| author | Dave Jacoby <jacoby.david@gmail.com> | 2023-07-31 09:33:10 -0400 |
|---|---|---|
| committer | Dave Jacoby <jacoby.david@gmail.com> | 2023-07-31 09:33:10 -0400 |
| commit | ecd08452c0bc55f0072f8d260ec830d4ec8cccc9 (patch) | |
| tree | 9ba31f20e804820e13ae16d0ab4491d93e5c9313 /challenge-227/eric-cheung/python/ch-1.py | |
| parent | 9a38bd2ff080991f73d7f49cebf2fbab06c69d94 (diff) | |
| parent | e511966ce2280dbedb2c916d9e6254708800639e (diff) | |
| download | perlweeklychallenge-club-ecd08452c0bc55f0072f8d260ec830d4ec8cccc9.tar.gz perlweeklychallenge-club-ecd08452c0bc55f0072f8d260ec830d4ec8cccc9.tar.bz2 perlweeklychallenge-club-ecd08452c0bc55f0072f8d260ec830d4ec8cccc9.zip | |
Merge branch 'master' of https://github.com/manwar/perlweeklychallenge-club
Diffstat (limited to 'challenge-227/eric-cheung/python/ch-1.py')
| -rwxr-xr-x | challenge-227/eric-cheung/python/ch-1.py | 13 |
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)
|
