How to retrieve an Enum key via variable

Viewed 7553

I'm new to python. Is it possible to get the value of an Enum key from a variable key?

class Numbering(Enum):
 a=2
 b=3

key = "b"
print(Numbering.key)
#the result I want is 3
1 Answers
Related