Skip to content

Instantly share code, notes, and snippets.

@carlynorama
Created May 29, 2018 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlynorama/357b33a0528d87ab4da9bb4150ef0188 to your computer and use it in GitHub Desktop.
Save carlynorama/357b33a0528d87ab4da9bb4150ef0188 to your computer and use it in GitHub Desktop.
What months have 5 Tuesdays?
#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