Jan-31-2020, 03:34 PM
There are two related problems in your classes. First, every class method must have at least one argument because the class instance is passed in as the first argument to a method. By convention, "self" is the name for this required argument.
Related to that, any time you call a method from the same class, you must call it as "self.method". Otherwise, that will return an error as well.
Related to that, any time you call a method from the same class, you must call it as "self.method". Otherwise, that will return an error as well.
class Flowers: def cleaningTask(self): pass def performCleaningTask(self): self.cleaningTask() class petalFlowers(Flowers): def cleanThePetals(self): print("petals are cleaned") def cleaningTask(self): self.cleanThePetals() class sprayFlowers(Flowers): def sprayWater(self): print("only water is sprayed") def cleaningTask(self): self.sprayWater()