enum in Python

An enumeration is a set of symbolic names bound to unique, constant values . Within an enumeration, the values can be compared by identity, and the enumeration itself can be iterated over. In Python 3.4 (PEP 435) , you can make Enum the base class.

Module and type name

from enum import Enum

How to creae an Enum in Python?

from enum import Enum class Directions(Enum): East, West,North,South = range(4) print(Directions.North.value)
output
2