Single Inheritance In Python
In this type of inheritance, one class will give its properties to other class.
Once inherited the properties,
Syntax :
- class inherited will become sub/derived/child class
- the one which gave properties will become super/base/parent class.
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
Post a Comment