Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python enum advanced

from enum import Enum

class Day(Enum):
    MONDAY = 1
    TUESDAY = 2
    WEDNESDAY = 3

# print the enum member
print(Day.MONDAY)

# get the name of the enum member
print(Day.MONDAY.name)

# get the value of the enum member
print(Day.MONDAY.value)
Comment

PREVIOUS NEXT
Code Example
Python :: pytohn reset all dictionary values to 0 
Python :: correlation for specific columns 
Python :: beautiful soap python get the link online 
Python :: substract list python 
Python :: tkinter delete toplevel 
Python :: scrapy get inside attribute value 
Python :: select python 
Python :: pandas rename 
Python :: doomsday fuel foobar 
Python :: CSV data source does not support array<string data type 
Python :: oserror: invalid cross-device link 
Python :: selenium webdriver options python 
Python :: fetch row where column is missing pandas 
Python :: python max function recursive 
Python :: how to have player input in python 
Python :: how split string in python by size 
Python :: python euclidean distance 
Python :: create button in pyqt 
Python :: float to int in python 
Python :: python pandas how to get all of the columns names 
Python :: python unittest discover 
Python :: df add value at first index 
Python :: escape sequence in python 
Python :: pathlib path forward or back slahses 
Python :: activate venv 
Python :: pandas reset index from 0 
Python :: compare times python 
Python :: deleting a file using python 
Python :: what is tensor in deep learning 
Python :: SyntaxError: positional argument follows keyword argument 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =