Answered step by step
Verified Expert Solution
Question
1 Approved Answer
class Student: def _ _ init _ _ ( self , firstname, lastname, major, year ) : self.firstname = firstname self.lastname = lastname self.major =
class Student:
def initself firstname, lastname, major, year:
self.firstname firstname
self.lastname lastname
self.major major
self.year year
def describeselfself:
return fselffirstnameselflastnameselfmajorselfyear
class StudentathleteStudent:
def describeselfself:
return fselffirstnameselflastnameselfmajorselfyear Athlete"
# Create an object Student that is an instance of the class Student
Student StudentHelen "Smith", "CIS", "Senior"
printStudentdescribeself
# Create an object Student that is an instance of the subclass Studentathlete
Student StudentathleteJohn "Smith", "CIS", "Senior"
printStudentdescribeself
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