Light Mode
Dark Mode
Do not understand where the error
    def checkio(f, t):
        itog = 0
        if f.isocalendar()==6 or f.isocalendar()==7:
            itog+=1
        delta=t-f
        itog+=((delta.days+f.isoweekday())//7)*2
        return itog

Fail: checkio(date(1999,1,1), date(2000,1,1))

When counting the turns 104, but the correct result is 105. I can not understand where the error is. Problem was solved in another way, but I still wonder what is wrong in this

Created: July 29, 2016, 9:17 p.m.
Updated: July 31, 2016, 7:56 a.m.
0
9
User avatar
greatdragone75