BarbVrat / kurz_python_2024

0 stars 0 forks source link

Odevzdaný úkol #1

Open BarbVrat opened 4 months ago

BarbVrat commented 4 months ago

Ahojky, odevzdala jsem úkol. Snad si správně pamatuju, že ti mám o tom dát vědět takto 😁 Pěkný večer Bára

evgeniyako-edu commented 4 months ago

Ahoj,

vypada to moc dobre!, jen par drobnosti (nemusis uz to opravovat, jestli se ti nechce ;))

1).

class Pizza(Item):
    def __init__(self, name : str, price : float, ingredients : dict):
        super().__init__(name, price)
        self.ingredients = ingredients
        ingredients = {}

To ingredients = {} na konci mne pride zbytecne, proc si myslis, ze to potrebujeme udelat?

2).

def add_extra(self, ingredient, quantity, price_per_ingredient):
        self.ingredients[ingredient] = quantity
        self.price += quantity * price_per_ingredient

To je super, ale myslim si, ze to nebude fungovat spravne, jestli nekdo prida navic ingredient, ktery uz v te pizze je (treba extra syr do margarity). Takze jeste ten extra ingredient uz je v self.ingredients, meli bychom ho mnozstvi zvysit o quantity.