Created
May 29, 2018 22:43
-
-
Save carlynorama/357b33a0528d87ab4da9bb4150ef0188 to your computer and use it in GitHub Desktop.
What months have 5 Tuesdays?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Thank you https://stackoverflow.com/questions/12973691/count-number-of-sundays-in-current-month | |
import calendar | |
year = 2018 | |
for m in range(1,13): | |
len([1 for i in calendar.monthcalendar(year, m) if i[1] != 0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment