Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for When is Friday? by brownie57
def friday(day):
from datetime import date
d, m, y = map(int, day.split('.'))
date = date(y,m,d)
w = date.weekday()
return (4 - w) % 7
if __name__ == '__main__':
print("Example:")
print(friday('23.04.2018'))
#These "asserts" using only for self-checking and not necessary for auto-testing
assert friday('23.04.2018') == 4
assert friday('01.01.1999') == 0
print("Coding complete? Click 'Check' to earn cool rewards!")
Aug. 2, 2018