Tomohiko Sakamoto 's Algorithm | function to implement tomohiko sakamoto algorithm ; array with leading number of days values ; if month is less than 3 reduce year by 1 ; Driver Code
def day_of_the_week ( y , m , d ) : NEW_LINE INDENT t = [ 0 , 3 , 2 , 5 , 0 , 3 , 5 , 1 , 4 , 6 , 2 , 4 ] NEW_LINE if ( m < 3 ) : NEW_LINE INDENT y = y - 1 NEW_LINE DEDENT return ( y + y // 4 - y // 100 + y // 400 + t [ m - 1 ] + d ) % 7 NEW_LINE DEDENT day = 13 NEW_LINE month = 7 NEW_LINE year = 2017 NEW_LINE print ( day_of_the_week ( year , month , day ) ) NEW_LINE