Wednesday, 20 June 2018

Python Program To demonstrate inheritance.

# Python Program To demonstrate inheritance.

# Parent Class
class parentCls:
    def __init__(self):
        print("Parent Class Constructor.")

    # definition   of Parent class methods
    def prntMethd_1(self):
        print("I am parent class method 1.")
    def prntMethd_2(self):
        print("I am parent class method 2.")

# Child Class
class childCls(parentCls):  # inherit to parent class
    def __init__(self):
        print("Child class constructor.")

    # definition   of child class methods
    def childMethd_1(self):
        print("I am child class method 1")
    def childMethd_2(self):
        print("I am child class method 2")

c = childCls()  # Child class instance

c.childMethd_1()    # child call it's method
c.childMethd_2()    # Again child call it's method
c.prntMethd_1()     # child call it's Parent class method
c.prntMethd_2()     # Again child call it's Parent class method

input("Press Enter to Exit")


  1. I have been meaning to write something like this on my website and you have given me an idea. Cheers.
    Python Online training

  2. Very Glad To share this Informative Blogs.This is one of the best Training Institute For Python with placements, Click on below to Explore and enhance More about it
    python training in chennai | python training in annanagar | python training in omr | python training in porur | python training in tambaram | python training in velachery

  3. Casino Review & Bonus - DrmCD
    Casino Review: ✓ Casino Bonuses 공주 출장샵 ✓ Casino Games ✓ Bonuses 경기도 출장마사지 ✓ Conclusion. Is 양산 출장샵 it 인천광역 출장안마 good to gamble with real money? Rating: 3 · ‎Review 서귀포 출장샵 by DrmCD

  4. محامي قضايا إرث بالرياض يبحث عنه الكثيرين من أجل الحصول على معلومات تحل النزاع الذي ينشب بين الورثة ودياً .من خلال حل المسألة الارثية وتحديد الأنصبة ، تتساءل كيف يكون ذلك ..؟ محامي قضايا الارث بالرياض سيرافقنا في رحلة شيقة محامي قضايا إرث بالرياض

  5. Web site for TotalFinder - the best Finder plugin around ... As a result, Apple Silicon support in TotalFinder must be manually enabled.
    Parallels Desktop 16.3 2 Crack

  6. Rohos Face Logon Download Crack Self Preparation: This allows you to maintain a strategic distance from the disappointment of face notoriety.Rohos Face Logon Free Download

  7. It is with happiness and pleasure that we invite you to be with us on the occasion of our child's baptism ceremony, as on this day we are joyfully bringing our .Baptism Invite Wording Catholic


Featured post

In all other cases the driver is not insured. If the marital status, sex and age of the driver are the inputs, write a program to determine whether the driver is to be insured or not.

  #include #include int main() { char ms;   printf("Is Driver married (Y/N): ");  scanf("%c",&ms);   if(ms=='y&#...

Popular Posts