What will be the output of the following Python code? [code] class Demo: def __check(self): return " Demo's check " def

Ngân Lam

New member
What will be the output of the following Python code?
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
 

Tìm kiếm

Back
Top