Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
roboman solution in Clear category for When is Friday? by viktor.chyrkin
import datetime as dt
def friday(day):
d = dt.datetime.strptime(day, '%d.%m.%Y')
return 5 - int(d.strftime('%w')) if int(d.strftime('%w')) < 6 else 6
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!")
Oct. 12, 2021
Comments: