Python 101 : The "Enum" object


Enum is python object that represents a group of variables that are assigned a constant value.

Below is a simple example - we need to include the "enum" package -:


"name" represents the names of the items in the enum and the "value" represents the values.

Remark:

The "25" integer in the print function is for spacing, so that we get an easily readable output.

Comments

Leave as a comment:

Archive