月份的枚举使用
上一节
下一节
from enum import Enum
Month = Enum('Month', ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'))
print(Month.Feb)
print(Month.Feb.value)
结果
Month.Feb
2

