Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #enum example
- #takes user input of month number and returns full month name
- choice = input("Enter the name of a month in the year")
- from enum import Enum
- class Months(Enum):
- January = 1
- February = 2
- March = 3
- April = 4
- May = 5
- June = 6
- July = 7
- August = 8
- September = 9
- October = 10
- November = 11
- December = 12
- print("You input",(choice))
- print Months.choice
Advertisement
Add Comment
Please, Sign In to add comment