Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

need help running this program, copy pasted it on my progeam but it can't run
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

=+ What graphics could stop the viewer?

Answered: 1 week ago

Question

=+What is the nature of the plant or site-level role of unions?

Answered: 1 week ago