QuesAns Print Page – CSKC
Sign In

Search

siteicon
Q&A CBSE12D-2015-B02A #6518

Question:

Illustrate the concept inheritance with the help of a python code

Answer:

class Base:
    def __init__ (self):
        print "Base Constructor at work..."
    def show(self):
        print "Hello Base"
class Der(Base):
    def __init__(self):
        print "Derived Constructor at work..."
    def display(self):
        print "Hello from Derived"