def __init__(self, currency):
self.currency = Currency.currency
class Currency(enum.IntEnum):
USD = 1
GBP = 2
EURO = 3
CHF = 4
RUB = 5
UAH = 18
class UseCurrency():
def __init__(self, currency):
self.currency = getattr(Currency(), currency)
def get_currency(self):
return self.currency
class Currency():
USD = 1
GBP = 2
EURO = 3
CHF = 4
RUB = 5
UAH = 18
obj = UseCurrency("USD")
print(obj.get_currency())