💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] # 第一种 ~~~ from enum import Enum week = Enum('Week', ('Sun', 'Tue', 'Wed')) print(week.Wed.value) //3 ~~~ 数字从1开始 # 第二种 ~~~ from enum import Enum, unique class Weekday(Enum): Sun = 'abc' Mon = 1 Tue = 2 Wed = 3 Thu = 4 print(Weekday.Sun.value) ~~~