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.
ENUM
Weekend?
Report a typo
Sample Input 1:
SATURDAYSample Output 1:
TrueWrite 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]))
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.