What is a class Concept of class can be better explained and understood by an example. Suppose an apartment of hundreds of flats need to be made. All the flats will be based on a design which is created by an architect. Now in future if more such flats need to constructed, then it can be easily done with the help of this design. This design can also be termed as a template or skeleton. Similar is the concept of a class. A class in an Object Oriented Programming language is a template, skeleton, blue print or design based on which objects are created. ARead More →

What is multiple inheritance When a child class extends more than one class or it has more than one parent class, then the type of inheritance is called multiple inheritance. Many programming languages do not support this type of inheritance but python supports it. Following illustration will clarify the concept of multiple inheritance. where a class can have more than one parent classes. Before moving on with this post, it is recommended to understand the concept of inheritance in python, if you are not already familiar with it. Python multiple inheritance syntax In order for a class to extend more than one classes, all its parentRead More →

What is inheritance Inheritance is one of the prominent features of Object Oriented Programming(OOPs). In fact, a language which does not support inheritance should not be called an Object Oriented Programming language. Inheritance involves more than one class where a class is a Parent and other classes are its children. This parent-child relationship can be at a single level where there is only one parent class and single or multiple child classes at the same level or at multiple levels where a parent class has child classes which also have their own children, these grand children may have their children and so on or aRead More →

What is operator overloading? Overloading an operator means adding it some behavior for your own customized requirements apart from its default operation. Example, + operator is used for adding two numbers, merging lists or concatenating strings but what if you want to add two objects of a class using +.  Consider the below class for understanding the concept better. class Course: def __init__(self, name, hours): self.name=name self.hours=hours Above code defines a class Course which has two fields name and hours. Now what if we create its objects and try to add them as shown. courseOne = Course(“python basics”, 10) courseTwo = Course(“python advanced”, 20) print(“TotalRead More →