I found this code which is supposed to illustrate how enums work. I'm aware things are differnt now in Python 3, but I want to make sense of this example. What do I need to input to get print("You chose the easy option") to execute please?
I've tried 1, Easy and Choice.Easy so far with no success.
def enum(**enums):
return type('Enum', (), enums)
Choice = enum(Easy = 1, Medium = 2, Hard = 3)
choice = input("Enter choice: ")
if choice == Choice.Easy:
print("You chose the easy option")
elif choice == Choice.Medium:
print("You chose the medium option")
elif choice == Choice.Hard:
print("You chose the hard option")
else:
print("You should choose one of the three levels!")