from enum import Enum


class PizzaSize(Enum):
    # Enum members written as: name = value
    small = {'price': 120, 'topping': 20}
    medium = {'price': 200, 'topping': 25}
    large = {'price': 280, 'topping': 30}
    jumbo = {'price': 500, 'topping': 50}

    def __str__(self):
        return self.name.title()

    def get_price(self, n_toppings: int):
        """Price of pizza depends on size and number of toppings."""
        price_of_toppings = self.value['topping'] * n_toppings
        price = self.value['price'] + price_of_toppings
        return price


if __name__ == '__main__':
    for size in PizzaSize:
        print(size.name, "pizza price: ", size.value)

