Examveda

What will be the output of the following Python 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: Option D


This Question Belongs to Python Program >> Classes And Objects In Python

Join The Discussion

Related Questions on Classes and Objects in Python