English

What is the output of the following program? class Greeting: def __init__(self, name): self.__name = name def display(self): print("Good Morning ", self.__name) obj=Greeting('Bindu Madhavan')

Advertisements

Question

What is the output of the following program?

class Greeting:
 def __init__(self, name):
 self.__name = name
 def display(self):
 print("Good Morning ", self.__name)
 obj=Greeting('Bindu Madhavan')
 obj.display()
One Line Answer
Advertisements

Solution

Good Morning BinduMadhavan

shaalaa.com
Sample Programs to Illustrate Classes and Objects
  Is there an error in this question or solution?
Chapter 10: Python Classes and objects - Evaluation [Page 188]
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×