Python 提供了 Enum 类来实现这个功能: from enum import Enum Month ... value 属性则是自动赋给成员的 int 常量,默认从 1 开始计数。
確定! 回上一頁