Question: need help running this program, copy pasted it on my progeam but it can't run 7 9. [10] Find the output printed by this program.
7 9. [10] Find the output printed by this program. Pay attention to the output sequence and inheritance, class Student: def _init__(self, name, year=1): print("Call init in Student") self.name = name self.year - year def _str_(self): return "Student: {} of year: {}".Format(self.name, self.year) def printStudent(self): print(self._str_()) class FasilkomStudent(Student): def __init__(self, name, year, major): super() . _init_(name, year) print("Call init in FasilkomStudent") self.major = major def _str_(self): return "Fasilkom Student: {} of major: {}".format(self.name, self.major) def main(): s = Student("Garfield") s.printStudent) FasilkomStudent("Bamby",2,"CS") s.printStudent) print(isinstance(s, Student)) SE #output 1 #output 2 #output 3 #output 4 #output 5 if name main() --'_main__
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
