Introduction: polymorphism is one of the many concepts in object oriented programming. I have previously discussed in details about different parts of object oriented programming in this OOPs post . In this post, we will discuss about polymorphism. Definition: In object oriented programming using a function for many purposes is termed as polymorphism. Polymorphism is a way to use the same function name, while it operates differently based on different parameters and classes it occurs in. I will explain it with a small example now. Example: Look at the following code: class examplesome: def __init__(self,a,b,c): self.a = a self.b = b self.c = c def funct(self): return self.a+self.b+self.c class examplesum: def __init__(self,a,b): self.a = a ...
I write about machine learning models, python programming, web scraping, statistical tests and other coding or data science related things I find interesting. Read, learn and grow with me!