Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for Weekend Counter by fed.kz
from datetime import date, timedelta
def checkio(date1, date2):
count = 0
while date1.weekday():
if date1.weekday() in (5, 6): count += 1
date1 += timedelta(1)
while date2.weekday():
if date2.weekday() in (5, 6): count += 1
date2 -= timedelta(1)
return count + (date2 - date1).days // 3.5
Oct. 12, 2018
Comments: