Question: Python class Person: def __init__(self, fname, lname): self.firstname = fname self.lastname = lname def printname(self): print(self.firstname, self.lastname) class Student(Person): pass x = Student(John, Dickerson) x.printname()
Python
class Person: def __init__(self, fname, lname):
self.firstname = fname
self.lastname = lname
def printname(self):
print(self.firstname, self.lastname)
class Student(Person):
pass x = Student("John", "Dickerson") x.printname() ________________________________________________________________
You need to create a class called "Automobile". It will have 2 properties "make" and "model". You will then use the automobile class to create an object with a method of "printcar" that will print the car's "make" and "model". You will also create a class called "Car". The class of "Car" will inherit the "Automobile" class. You will then ask the user to input an automobile make as well as an automobile model, which will call the class "Car" and pass it the automobile make and model. The end result is that you print out the automobile's make and model from the printcar method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
