Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #enum #python #print #options
ADD COMMENT
Topic
Name
4+8 =