Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python class called Animal that contains two private attributes: a name to store the name of the animal and a weight that will
Write a Python class called Animal that contains two private attributes: a name to store the name of the animal and a weight that will contain the weight of the Animal in Kilograms. Add a methods who(), that displays a messages giving the name and weight of the Animal object. Derive two classes named Lion and Monkey, using Animal as a base class. Create Lion and Monkey objects. Demonstrate that the who() method is inherited from Animal class. Add setter and getter methods
. Example objects : Leo at 101 Kg. Mandrill at 30 Kg
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started