I have the following enum defined:

from enum import Enum
class D(Enum):
    x = 1
    y = 2

print(D.x)

now the printed value is

D.x

instead, I wanted the enum’s value to be print

1

What can be done to achieve this functionality?

5 Answers
5

Leave a Reply

Your email address will not be published. Required fields are marked *