Implement the Fruit class with the size, weight (numeric values) and taste (string) variables, inherit the apple classes with the new color variable (string value) and orange with the color variable, but without taste. Put two apples and an orange in FruitBasket.
The question is, if I inherit Orange from Fruit, how can I not inherit from a variable taste?
So does not pass, writes that 1 argument is lost.
class Fruit: def __init__(self, size, weight, taste): self.size = size self.weight = weight self._taste = taste class Apple(Fruit): def __init__(self, size, weight, _taste, color): super().__init__(size, weight, _taste) self.color = color class Orange(Fruit): def __init__(self, size, weight, color): super().__init__(size, weight) self.color = color first_apple = Apple(1, 5, 'Сочное', 'Красное') second_apple = Apple(2, 7, 'Кислое', 'Зеленое') orange = Orange(3, 8, 'Оранжевый')