Language is python ● Take user inputs that ask for the name, age, hair colour and eye colour of a person. ● Create an ad

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Language is python ● Take user inputs that ask for the name, age, hair colour and eye colour of a person. ● Create an ad

Post by answerhappygod »

Language is python
● Take user inputs that ask for the name, age, hair colour and eye colour of aperson.● 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 andthat they are old enough to drive.● Create a subclass of the adult class named “Child” that has the sameattributes, but overrides the can_drive method to print the persons nameand that they are too young to drive.● Create some logic that determines if the person is 18 or older and create aninstance of the Adult class if this is true. Otherwise, create an instance of theChild class. Once the object has been created, call the can_drive() method toprint out whether the person is old enough to drive or not.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply