Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
datetime strptime weekday solution in Clear category for When is Friday? by kdim
from datetime import datetime
def friday(day):
return (4 - datetime.strptime(day, '%d.%m.%Y').weekday()) % 7
if __name__ == '__main__':
print("Example:")
print(friday('23.04.2018'))
assert friday('23.04.2018') == 4
assert friday('01.01.1999') == 0
print("Coding complete? Click 'Check' to earn cool rewards!")
Feb. 26, 2021
Comments: