Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
weekday() solution in Clear category for When is Friday? by kurosawa4434
from datetime import date
def friday(day):
d, m, y = map(int, day.split('.'))
wd = date(y, m, d).weekday()
return [4, 11][wd > 4] - wd
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
assert friday('11.11.1111') == 6
print("Coding complete? Click 'Check' to earn cool rewards!")
April 27, 2018
Comments: