InterviewSolution
Saved Bookmarks
| 1. |
Find the output of the following code and write the type of inheritance:p=Gstudent(‘Mona’, 20,12, $9, ‘computer’)def_init_(self, name, age, roll no, marks, stream):super (Gstudent, self) _init_(name, age, roll no, marks)self stream=streamdef display 2 (self):self display()print “stream:”,self.stream P=Gstudent (‘Mona’, 20,12, 99, ‘Computer’)p.display2() |
|
Answer» Type of inheritance: Multilevel Output: Name: Mona Age: 20 Roll No: 12 Marks: 99 stream: computer |
|