Post
Python
Can you explain me the best way to implement enums in Python?
Posted on 28th January 2023
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?
Copyright © 2013 - 2023 MindMajix Technologies