Post
Python
Can you explain me the best way to implement enums in Python?
Posted on 25th April 2024
Hey Divija,
You can try the following method:
from enum import Enum
class Class(Enum):
A = 1
B= 2
C = 3
print(repr(Class.a))
STILL GOT QUERIES?