SlideShare a Scribd company logo
POLYMORPHISM
PRESENTED BY:
SIMRAN PARDESHI (36)
INTRODUCTION
• In programming, polymorphism means the same function name (but different
signatures) being used for different types.
• In Python, Polymorphism lets us define methods in the child class that have
the same name as the methods in the parent class. In inheritance, the child
class inherits the methods from the parent class. However, it is possible to
modify a method in a child class that it has inherited from the parent class.
Exampleof inbuilt polymorphic functions:
• CODE:
• OUTPUT:
Polymorphism with class methods:
• The below code shows how Python can use two different class types, in the same way. We create a for
loop that iterates through a tuple of objects. Then call the methods without being concerned about
which class type each object is. We assume that these methods actually exist in each class.
• CODE:
• OUTPUT:
Polymorphismwith Inheritance:
• In Python, Polymorphism lets us define methods in the child class that have the same name
as the methods in the parent class. In inheritance, the child class inherits the methods from
the parent class. However, it is possible to modify a method in a child class that it has
inherited from the parent class. This is particularly useful in cases where the method
inherited from the parent class doesn’t quite fit the child class. In such cases, we re-
implement the method in the child class. This process of re-implementing method in the
child class is known as Method Overriding.
• CODE:
• OUTPUT:
CONCLUSION
•Polymorphism is a very important concept in Object-
Oriented Programming. We can use the concept of
polymorphism while creating class methods as Python
allows different classes to have methods with the same
name.
THANK YOU!
Ad

More Related Content

What's hot (20)

Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
Mohammed Sikander
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
Class, object and inheritance in python
Class, object and inheritance in pythonClass, object and inheritance in python
Class, object and inheritance in python
Santosh Verma
 
Python-Classes.pptx
Python-Classes.pptxPython-Classes.pptx
Python-Classes.pptx
Karudaiyar Ganapathy
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
Devashish Kumar
 
CLASS OBJECT AND INHERITANCE IN PYTHON
CLASS OBJECT AND INHERITANCE IN PYTHONCLASS OBJECT AND INHERITANCE IN PYTHON
CLASS OBJECT AND INHERITANCE IN PYTHON
Lalitkumar_98
 
Oop concepts in python
Oop concepts in pythonOop concepts in python
Oop concepts in python
baabtra.com - No. 1 supplier of quality freshers
 
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAPYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
Maulik Borsaniya
 
Packages In Python Tutorial
Packages In Python TutorialPackages In Python Tutorial
Packages In Python Tutorial
Simplilearn
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
Mohammed Sikander
 
Chapter 07 inheritance
Chapter 07 inheritanceChapter 07 inheritance
Chapter 07 inheritance
Praveen M Jigajinni
 
Python-Polymorphism.pptx
Python-Polymorphism.pptxPython-Polymorphism.pptx
Python-Polymorphism.pptx
Karudaiyar Ganapathy
 
Python OOPs
Python OOPsPython OOPs
Python OOPs
Binay Kumar Ray
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
Haresh Jaiswal
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Edureka!
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
kamal kotecha
 
Object Oriented Programming in Python
Object Oriented Programming in PythonObject Oriented Programming in Python
Object Oriented Programming in Python
Sujith Kumar
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
Class, object and inheritance in python
Class, object and inheritance in pythonClass, object and inheritance in python
Class, object and inheritance in python
Santosh Verma
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
Devashish Kumar
 
CLASS OBJECT AND INHERITANCE IN PYTHON
CLASS OBJECT AND INHERITANCE IN PYTHONCLASS OBJECT AND INHERITANCE IN PYTHON
CLASS OBJECT AND INHERITANCE IN PYTHON
Lalitkumar_98
 
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAPYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
Maulik Borsaniya
 
Packages In Python Tutorial
Packages In Python TutorialPackages In Python Tutorial
Packages In Python Tutorial
Simplilearn
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Edureka!
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
kamal kotecha
 
Object Oriented Programming in Python
Object Oriented Programming in PythonObject Oriented Programming in Python
Object Oriented Programming in Python
Sujith Kumar
 

Similar to Polymorphism in Python (20)

polymorphismppt for Computer Applications-211218133624.pptx
polymorphismppt for  Computer Applications-211218133624.pptxpolymorphismppt for  Computer Applications-211218133624.pptx
polymorphismppt for Computer Applications-211218133624.pptx
waarrior1234567
 
arthimetic operator,classes,objects,instant
arthimetic operator,classes,objects,instantarthimetic operator,classes,objects,instant
arthimetic operator,classes,objects,instant
ssuser77162c
 
Learn Polymorphism in Python with Examples.pdf
Learn Polymorphism in Python with Examples.pdfLearn Polymorphism in Python with Examples.pdf
Learn Polymorphism in Python with Examples.pdf
Datacademy.ai
 
Polymorphism.pptx
Polymorphism.pptxPolymorphism.pptx
Polymorphism.pptx
TuanMinhHuynh3
 
OOPS (Object Oriented Programming System) CONCEPTS
OOPS (Object Oriented Programming System) CONCEPTSOOPS (Object Oriented Programming System) CONCEPTS
OOPS (Object Oriented Programming System) CONCEPTS
HariShiva7
 
28csharp
28csharp28csharp
28csharp
Sireesh K
 
28c
28c28c
28c
Sireesh K
 
Object Oriented Programming.pptx
Object Oriented Programming.pptxObject Oriented Programming.pptx
Object Oriented Programming.pptx
SAICHARANREDDYN
 
Object-Oriented Programming System presentation
Object-Oriented Programming System presentationObject-Oriented Programming System presentation
Object-Oriented Programming System presentation
PavanKumarPathipati
 
Introduction to Object Oriented Programming in Python.pptx
Introduction to Object Oriented Programming in Python.pptxIntroduction to Object Oriented Programming in Python.pptx
Introduction to Object Oriented Programming in Python.pptx
eduardocehenmu
 
Class and Objects in python programming.pptx
Class and Objects in python programming.pptxClass and Objects in python programming.pptx
Class and Objects in python programming.pptx
Rajtherock
 
Java programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- InheritanceJava programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- Inheritance
Jyothishmathi Institute of Technology and Science Karimnagar
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Nadeesha Thilakarathne
 
OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)
baabtra.com - No. 1 supplier of quality freshers
 
Oops
OopsOops
Oops
baabtra.com - No. 1 supplier of quality freshers
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPSQuestpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
javainheritance
javainheritancejavainheritance
javainheritance
Arjun Shanka
 
Method overloading and method overriding
Method overloading and method overridingMethod overloading and method overriding
Method overloading and method overriding
RomitRajSingh1
 
inheritance in python with full detail.ppt
inheritance in python with full detail.pptinheritance in python with full detail.ppt
inheritance in python with full detail.ppt
ssuser7b0a4d
 
OOP- PolymorphismFinal12injavait101.pptx
OOP- PolymorphismFinal12injavait101.pptxOOP- PolymorphismFinal12injavait101.pptx
OOP- PolymorphismFinal12injavait101.pptx
codevincent624
 
polymorphismppt for Computer Applications-211218133624.pptx
polymorphismppt for  Computer Applications-211218133624.pptxpolymorphismppt for  Computer Applications-211218133624.pptx
polymorphismppt for Computer Applications-211218133624.pptx
waarrior1234567
 
arthimetic operator,classes,objects,instant
arthimetic operator,classes,objects,instantarthimetic operator,classes,objects,instant
arthimetic operator,classes,objects,instant
ssuser77162c
 
Learn Polymorphism in Python with Examples.pdf
Learn Polymorphism in Python with Examples.pdfLearn Polymorphism in Python with Examples.pdf
Learn Polymorphism in Python with Examples.pdf
Datacademy.ai
 
OOPS (Object Oriented Programming System) CONCEPTS
OOPS (Object Oriented Programming System) CONCEPTSOOPS (Object Oriented Programming System) CONCEPTS
OOPS (Object Oriented Programming System) CONCEPTS
HariShiva7
 
Object Oriented Programming.pptx
Object Oriented Programming.pptxObject Oriented Programming.pptx
Object Oriented Programming.pptx
SAICHARANREDDYN
 
Object-Oriented Programming System presentation
Object-Oriented Programming System presentationObject-Oriented Programming System presentation
Object-Oriented Programming System presentation
PavanKumarPathipati
 
Introduction to Object Oriented Programming in Python.pptx
Introduction to Object Oriented Programming in Python.pptxIntroduction to Object Oriented Programming in Python.pptx
Introduction to Object Oriented Programming in Python.pptx
eduardocehenmu
 
Class and Objects in python programming.pptx
Class and Objects in python programming.pptxClass and Objects in python programming.pptx
Class and Objects in python programming.pptx
Rajtherock
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPSQuestpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
Method overloading and method overriding
Method overloading and method overridingMethod overloading and method overriding
Method overloading and method overriding
RomitRajSingh1
 
inheritance in python with full detail.ppt
inheritance in python with full detail.pptinheritance in python with full detail.ppt
inheritance in python with full detail.ppt
ssuser7b0a4d
 
OOP- PolymorphismFinal12injavait101.pptx
OOP- PolymorphismFinal12injavait101.pptxOOP- PolymorphismFinal12injavait101.pptx
OOP- PolymorphismFinal12injavait101.pptx
codevincent624
 
Ad

More from Home (20)

DIABETES PREDICTION SYSTEM .pptx
DIABETES PREDICTION SYSTEM .pptxDIABETES PREDICTION SYSTEM .pptx
DIABETES PREDICTION SYSTEM .pptx
Home
 
data science pptx
data science pptxdata science pptx
data science pptx
Home
 
HARDWARE AND SOFTWARE.pptx
HARDWARE AND SOFTWARE.pptxHARDWARE AND SOFTWARE.pptx
HARDWARE AND SOFTWARE.pptx
Home
 
Rock ,Paper, Scissors IAI .pptx
Rock ,Paper, Scissors IAI .pptxRock ,Paper, Scissors IAI .pptx
Rock ,Paper, Scissors IAI .pptx
Home
 
Graph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptxGraph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptx
Home
 
Fighting climate change using agritech
Fighting climate change using agritech Fighting climate change using agritech
Fighting climate change using agritech
Home
 
APPLICATION OF GROUPS IN CRYPTOGRAPHY
APPLICATION OF GROUPS IN CRYPTOGRAPHYAPPLICATION OF GROUPS IN CRYPTOGRAPHY
APPLICATION OF GROUPS IN CRYPTOGRAPHY
Home
 
ECONOMIC RIGHTS.pptx
ECONOMIC RIGHTS.pptxECONOMIC RIGHTS.pptx
ECONOMIC RIGHTS.pptx
Home
 
Hamiltonian cycle in data structure 2
Hamiltonian cycle in data structure  2Hamiltonian cycle in data structure  2
Hamiltonian cycle in data structure 2
Home
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)
Home
 
Water scarcity and its remedial measures
Water scarcity and its remedial measuresWater scarcity and its remedial measures
Water scarcity and its remedial measures
Home
 
Multimedia operating system
Multimedia operating systemMultimedia operating system
Multimedia operating system
Home
 
Dsdco IE: RISC and CISC architectures and design issues
Dsdco IE: RISC and CISC architectures and design issuesDsdco IE: RISC and CISC architectures and design issues
Dsdco IE: RISC and CISC architectures and design issues
Home
 
Dbms mini project
Dbms mini projectDbms mini project
Dbms mini project
Home
 
IMPORTANCE OF COMMUNICATION IN PERSONAL AND PROFESSIONAL LIFE
IMPORTANCE OF COMMUNICATION IN PERSONAL AND PROFESSIONAL LIFEIMPORTANCE OF COMMUNICATION IN PERSONAL AND PROFESSIONAL LIFE
IMPORTANCE OF COMMUNICATION IN PERSONAL AND PROFESSIONAL LIFE
Home
 
ACTIVITY BASED LEARNING THROUGH ONLINE COLLEGE
ACTIVITY BASED LEARNING THROUGH ONLINE COLLEGEACTIVITY BASED LEARNING THROUGH ONLINE COLLEGE
ACTIVITY BASED LEARNING THROUGH ONLINE COLLEGE
Home
 
SMART WASTE MANAGEMENT AND RAINWATER HARVESTING
SMART WASTE MANAGEMENT AND RAINWATER HARVESTINGSMART WASTE MANAGEMENT AND RAINWATER HARVESTING
SMART WASTE MANAGEMENT AND RAINWATER HARVESTING
Home
 
Rock , paper and scissors game made with PYTHON
Rock , paper and  scissors game made with PYTHON Rock , paper and  scissors game made with PYTHON
Rock , paper and scissors game made with PYTHON
Home
 
Chemistry (biomass and recyclable polymers)
Chemistry (biomass and recyclable polymers)Chemistry (biomass and recyclable polymers)
Chemistry (biomass and recyclable polymers)
Home
 
Basic electrical engineering (Autotransformer)
Basic electrical engineering (Autotransformer)Basic electrical engineering (Autotransformer)
Basic electrical engineering (Autotransformer)
Home
 
DIABETES PREDICTION SYSTEM .pptx
DIABETES PREDICTION SYSTEM .pptxDIABETES PREDICTION SYSTEM .pptx
DIABETES PREDICTION SYSTEM .pptx
Home
 
data science pptx
data science pptxdata science pptx
data science pptx
Home
 
HARDWARE AND SOFTWARE.pptx
HARDWARE AND SOFTWARE.pptxHARDWARE AND SOFTWARE.pptx
HARDWARE AND SOFTWARE.pptx
Home
 
Rock ,Paper, Scissors IAI .pptx
Rock ,Paper, Scissors IAI .pptxRock ,Paper, Scissors IAI .pptx
Rock ,Paper, Scissors IAI .pptx
Home
 
Graph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptxGraph coloring problem(DAA).pptx
Graph coloring problem(DAA).pptx
Home
 
Fighting climate change using agritech
Fighting climate change using agritech Fighting climate change using agritech
Fighting climate change using agritech
Home
 
APPLICATION OF GROUPS IN CRYPTOGRAPHY
APPLICATION OF GROUPS IN CRYPTOGRAPHYAPPLICATION OF GROUPS IN CRYPTOGRAPHY
APPLICATION OF GROUPS IN CRYPTOGRAPHY
Home
 
ECONOMIC RIGHTS.pptx
ECONOMIC RIGHTS.pptxECONOMIC RIGHTS.pptx
ECONOMIC RIGHTS.pptx
Home
 
Hamiltonian cycle in data structure 2
Hamiltonian cycle in data structure  2Hamiltonian cycle in data structure  2
Hamiltonian cycle in data structure 2
Home
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)
Home
 
Water scarcity and its remedial measures
Water scarcity and its remedial measuresWater scarcity and its remedial measures
Water scarcity and its remedial measures
Home
 
Multimedia operating system
Multimedia operating systemMultimedia operating system
Multimedia operating system
Home
 
Dsdco IE: RISC and CISC architectures and design issues
Dsdco IE: RISC and CISC architectures and design issuesDsdco IE: RISC and CISC architectures and design issues
Dsdco IE: RISC and CISC architectures and design issues
Home
 
Dbms mini project
Dbms mini projectDbms mini project
Dbms mini project
Home
 
IMPORTANCE OF COMMUNICATION IN PERSONAL AND PROFESSIONAL LIFE
IMPORTANCE OF COMMUNICATION IN PERSONAL AND PROFESSIONAL LIFEIMPORTANCE OF COMMUNICATION IN PERSONAL AND PROFESSIONAL LIFE
IMPORTANCE OF COMMUNICATION IN PERSONAL AND PROFESSIONAL LIFE
Home
 
ACTIVITY BASED LEARNING THROUGH ONLINE COLLEGE
ACTIVITY BASED LEARNING THROUGH ONLINE COLLEGEACTIVITY BASED LEARNING THROUGH ONLINE COLLEGE
ACTIVITY BASED LEARNING THROUGH ONLINE COLLEGE
Home
 
SMART WASTE MANAGEMENT AND RAINWATER HARVESTING
SMART WASTE MANAGEMENT AND RAINWATER HARVESTINGSMART WASTE MANAGEMENT AND RAINWATER HARVESTING
SMART WASTE MANAGEMENT AND RAINWATER HARVESTING
Home
 
Rock , paper and scissors game made with PYTHON
Rock , paper and  scissors game made with PYTHON Rock , paper and  scissors game made with PYTHON
Rock , paper and scissors game made with PYTHON
Home
 
Chemistry (biomass and recyclable polymers)
Chemistry (biomass and recyclable polymers)Chemistry (biomass and recyclable polymers)
Chemistry (biomass and recyclable polymers)
Home
 
Basic electrical engineering (Autotransformer)
Basic electrical engineering (Autotransformer)Basic electrical engineering (Autotransformer)
Basic electrical engineering (Autotransformer)
Home
 
Ad

Recently uploaded (20)

MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Compiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptxCompiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptx
RushaliDeshmukh2
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Compiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptxCompiler Design Unit1 PPT Phases of Compiler.pptx
Compiler Design Unit1 PPT Phases of Compiler.pptx
RushaliDeshmukh2
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 

Polymorphism in Python

  • 2. INTRODUCTION • In programming, polymorphism means the same function name (but different signatures) being used for different types. • In Python, Polymorphism lets us define methods in the child class that have the same name as the methods in the parent class. In inheritance, the child class inherits the methods from the parent class. However, it is possible to modify a method in a child class that it has inherited from the parent class.
  • 3. Exampleof inbuilt polymorphic functions: • CODE:
  • 5. Polymorphism with class methods: • The below code shows how Python can use two different class types, in the same way. We create a for loop that iterates through a tuple of objects. Then call the methods without being concerned about which class type each object is. We assume that these methods actually exist in each class. • CODE:
  • 7. Polymorphismwith Inheritance: • In Python, Polymorphism lets us define methods in the child class that have the same name as the methods in the parent class. In inheritance, the child class inherits the methods from the parent class. However, it is possible to modify a method in a child class that it has inherited from the parent class. This is particularly useful in cases where the method inherited from the parent class doesn’t quite fit the child class. In such cases, we re- implement the method in the child class. This process of re-implementing method in the child class is known as Method Overriding.
  • 10. CONCLUSION •Polymorphism is a very important concept in Object- Oriented Programming. We can use the concept of polymorphism while creating class methods as Python allows different classes to have methods with the same name.