“Enum Python String” Code-Antworten

Enum Python String

from enum import Enum
 
class FRUITS(Enum):
     APPLE = 1
     ORANGE = 2
     GRAPES = 3
 
 
 
print ("The print enum memebr as string :\n ",end="")
print (FRUITS.APPLE)
print (FRUITS.ORANGE)
print (FRUITS.GRAPES)
 
print ("\n Print Name of enum member : \n",end ="")
print (FRUITS.APPLE)
print (FRUITS.ORANGE)
print (FRUITS.GRAPES)
DreamCoder

Python Enum

An enumeration is a set of symbolic names (members) bound to unique, constant values. Within an enumeration, the members can be compared by identity, and the enumeration itself can be iterated over.
Busy Batfish

Ähnliche Antworten wie “Enum Python String”

Fragen ähnlich wie “Enum Python String”

Weitere verwandte Antworten zu “Enum Python String” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen