Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. Daynum = 1
  2. monthpos = 1
  3. daypos = 2
  4. year = 1901
  5. count = 0
  6. while year < 2001:
  7.         while monthpos < 13:
  8.             if daypos%7 == 0:
  9.                 count = count + 1
  10.             if monthpos == 1 or monthpos == 3 or monthpos == 5 or monthpos ==7 or monthpos==8 or monthpos==10 or monthpos==12:
  11.                 daypos = daypos + 3
  12.                 monthpos = monthpos + 1
  13.             elif monthpos == 4 or monthpos==6 or monthpos==9 or monthpos==11:
  14.                 daypos = daypos + 2
  15.                 monthpos = monthpos + 1
  16.             else:
  17.                 if year%4 > 0:
  18.                     daypos = daypos
  19.                     monthpos = monthpos + 1
  20.                 else:
  21.                     daypos = daypos + 1
  22.                     monthpos = monthpos + 1
  23.         monthpos = 1
  24.         year = year + 1
  25. print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement