Single Inheritance

 

Single Inheritance In Python



In this type of inheritance, one class will give its properties to other class.


Once inherited the properties,
  • class inherited will become sub/derived/child class
  • the one which gave properties will become super/base/parent class.

Syntax :

                keyword_class keyword class_name :
                -------------------- statement-1
                -------------------- statement-2

                keyword_class class_name (super class_name) : 

                -------------------- statement-1
        keyword_def method_name() :
        -------------------- statement-2


Example : 

hi



Comments

My photo
Techno Xpresss
Bangalore, Karnataka, India