Question: farm _ animal.py : FarmAnimal All farm animals have constructor that has a single age ( in years ) instance attribute ( use self.age as
farmanimal.py : FarmAnimal
All farm animals have constructor that has a single age in years instance attribute use self.age as the name
All farm animals have a str conversion method that prints the class type and age; you can do this with only a single str method in the FarmAnimal or you can override as needed.
All farm animals have a makesound method that returns a string
The method in FarmAnimal should just return an empty string
All farm animals have an equal eq method that returns true if the objects are the same class type and the same age
That is two yearold Hen instances are equivalent, but a Cow and Duck are never equivalent.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
