Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

enum python string

from enum import Enum
 
class FRUITS(Enum):
     APPLE = 1
     ORANGE = 2
     GRAPES = 3
 
 
 
print ("The print enum memebr as string :
 ",end="")
print (FRUITS.APPLE)
print (FRUITS.ORANGE)
print (FRUITS.GRAPES)
 
print ("
 Print Name of enum member : 
",end ="")
print (FRUITS.APPLE)
print (FRUITS.ORANGE)
print (FRUITS.GRAPES)
Source by devenum.com #
 
PREVIOUS NEXT
Tagged: #enum #python #string
ADD COMMENT
Topic
Name
6+9 =