Python minimal enum (enum.Enum) example
python-minimal-enum-enum-enum-example.py
from enum import Enum
class Shape(Enum):
Circle = 0
Square = 1
Hexagon = 2
# Usage example
print(Shape.Square) # prints Shape.Square
Based on the official enum package docs.
Check out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow