Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

enum python print all options

from enum import Enum

class Letter(Enum):
   A = 1
   B = 2
   C = 3

print({i.name: i.value for i in Letter})
# prints {'A': 1, 'B': 2, 'C': 3}
Comment

PREVIOUS NEXT
Code Example
Python :: python cointegration 
Python :: df shape 
Python :: get output of a function in a variable python 
Python :: Power Crisis 
Python :: Adding two lists using map() and Lamda Function 
Python :: algebraic pyramid python 
Python :: python emoji convert 
Python :: bytestring python 
Python :: scrape pdf out of link 
Python :: django http response 204 
Python :: python toupls 
Python :: python find all occurrence in string 
Python :: python remove specific character from string 
Python :: convert plt.show to image to show opencv 
Python :: Finding Maximum Elements along columns using Python numpy.argmax() 
Python :: how to do formatting in python with format function 
Python :: pandas append sheet to workbook 
Python :: Converting categorical variable to numeric variable in python 
Python :: centos install python 3.9 thelinuxterminal.com 
Python :: python dict to string 
Python :: rolling std dev of a pandas series 
Python :: convert all columns to float pandas 
Python :: mountain array leetcode 
Python :: how to create a function in python 
Python :: pandas change string column to datetime 
Python :: python re.findall() 
Python :: capitalise texts 
Python :: django log queryset 
Python :: split string by special characters python 
Python :: python vars keyword 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =