Polymorphism
In its literal meaning, a process of having multiple forms is called polymorphism. In OOP, polymorphism is the ability of an instance to behave in multiple ways and a way to use the same method with the same name and the same arguments, to behave differently in accordance with the class it belongs to.
Polymorphism can be implemented in two ways: method overloading and method overriding. We will discuss each in the next subsections.
Method overloading
Method overloading is a way to achieve polymorphism by having multiple methods with the same name, but with a different type or number of arguments. There is no clean way to implement method overloading in Python. Two methods cannot have the same name in Python. In Python, everything is an object, including classes and methods. When we write methods for a class, they are in fact attributes of a class from the namespace perspective and thus cannot have the same name. If we write two methods with the same name, there...