Question: Hello There Kindly assist with complete code and comments / explanation. Thank you in advance :) Intro to OOP II - Inheritance Q2. reate a
Hello There
Kindly assist with complete code and comments / explanation.
Thank you in advance :)
Intro to OOP II - Inheritance
Q2.

reate a file named method_override.py and follow the following instructions: - Take user inputs that ask for the name, age, hair colour and eye colour of a person. - Create an adult class with the following attributes and method: - name, age, eye_colour, hair_colour - Method called can_drive() that prints the name of the person and that they are old enough to drive. - Create a subclass of the adult class named "Child" that has the same attributes, but overrides the can_drive method to print the persons name and that they are too young to drive. - Create some logic that determines if the person is 18 or older and create an instance of the Adult class if this is true. Otherwise, create an instance of the Child class. Once the object has been created, call the can_drive() method to print out whether the person is old enough to drive or not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
