How can I access an enum member with an input in python

后端 未结 0 1413
醉梦人生
醉梦人生 2021-01-11 12:11
class Animals(Enum){
Dog = 1
Cat = 2
Cow = 3 
}

Choose = input(\'Choose an animal\')

print(Animals.Choose.value)

gives me an error perhaps because

相关标签:
回答
  • 消灭零回复
提交回复
热议问题