With the help of
enum.auto() method, we can get the assigned integer value automatically by just using
Automatically assign the integer value to the values of enum class attributes.
Example #1 :
In this example we can see that by using
enum.auto() method, we are able to assign the numerical values automatically to the class attributes by using this method.
Example #2 :
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.