py enums code example
Example: python enums
import enum
class Days(enum.Enum):
Sun = 1
Mon = 2
Tue = 3
print ("The enum members are : ")
for weekday in (Days):
print(weekday)
# The enum members are :
# Days.Sun
# Days.Mon
# Days.Tue
best_day = Days.Sun
worst_day = Days(2)
print(best_day) # Days.Sun
print(worst_day) # Days.Mon