Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Python by mingmatrix ( 9 years ago )
import datetime

start = datetime.date(2017,1,1)

end = datetime.date(2017,12,28)

diff = end-start

print diff.days

days = {0: 0,1: 0,2: 0,3: 0,4: 0,5: 0,6: 0}

full_weeks = (diff.days) / 7

remainder = (diff.days) % 7

first_day = start.weekday() # Start date is on Monday

for day in days.keys():

days[day] = full_weeks

for i in range(0, remainder):

days[(first_day + i) % 7] += 1

print days[4]

 

Revise this Paste

Your Name: Code Language: