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.
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.
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow