Weekend?

Report a typo

Define an Enum class called DaysOfWeek with the seven days of the week as values. Then, write a function called is_weekend that takes in a day of the week as a parameter and returns True if it's a weekend day (Saturday or Sunday) and False, if otherwise.

Sample Input 1:

SATURDAY

Sample Output 1:

True
Write a program in Python 3
from enum import Enum

class DaysOfWeek(Enum):
MONDAY = 1
TUESDAY = 2
WEDNESDAY = 3
THURSDAY = 4
FRIDAY = 5
SATURDAY = 6
SUNDAY = 7

def is_weekend(day):
pass

# sample usage
DAY = input()
print(is_weekend(DaysOfWeek[DAY]))
___

Create a free account to access the full topic