Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
timedelta solution in Clear category for Weekend Counter by OrginalS
from datetime import date, timedelta
def checkio(from_date, to_date):
res = 0
while from_date != to_date + timedelta(days=1):
if from_date.weekday() > 4:
res += 1
from_date += timedelta(days=1)
return res
Oct. 24, 2019
Comments: