adplus-dvertising
frame-decoration

Question

What is the output of the following piece of code?
class stud:
   ‘Base class for all students’
   def __init__(self, roll_no, grade):
      self.roll_no = roll_no
      self.grade = grade
   def display (self):
      print("Roll no : ", self.roll_no,  ", Grade: ", self.grade)
print(student.__doc__)

a.

Exception is thrown

b.

__main__

c.

Nothing is displayed

d.

Base class for all students

Answer: (d).Base class for all students

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following piece of code?