Q:

Write a Python program to create an Enum object and display a member name and value

0

Write a Python program to create an Enum object and display a member name and value.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

from enum import Enum
class Country(Enum):
    Afghanistan = 93
    Albania = 355
    Algeria = 213
    Andorra = 376
    Angola = 244
    Antarctica = 672
print('\nMember name: {}'.format(Country.Albania.name))
print('Member value: {}'.format(Country.Albania.value))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now