• + 0 comments

    Maybe my solution could inspire someone :

    I have noticed with print() that weekday() return a number corresponding to the day in a week. (Monday = 0, Tuesday = 1, Wednesday = 2 ... Sunday = 6).

    So I have created a dictionnary and use it with the function calendar.weekday() to return the good day name :

    import calendar
    
    date = list(map(int, input().split()))
    
    days = {
        0: "MONDAY",
        1: "TUESDAY",
        2: "WEDNESDAY",
        3: "THURSDAY",
        4: "FRIDAY",
        5: "SATURDAY",
        6: "SUNDAY"
    }
    
    day_in_week = calendar.weekday(date[2], date[0], date[1])
    print(days[day_in_week])