Examveda

What will be the output of the following Python code?
class Demo:
    def __check(self):
        return " Demo's check "
    def display(self):
        print(self.check())
class Demo_Derived(Demo):
    def __check(self):
        return " Derived's check "
Demo().display()
Demo_Derived().display()

A. Demo's check Derived's check

B. Demo's check Demo's check

C. Derived's check Demo's check

D. Syntax error

Answer: Option B


Join The Discussion

Related Questions on Concept of Object Oriented Programs in Python