Source Code:
(back to article)
from enum import Enum Color = Enum('Color', ['RED', 'GREEN', 'BLUE']) for color in Color: print(color)
Result:
Report an issue