SlideShare a Scribd company logo
2
OOP
Object-oriented programming (OOP) involves programming using objects.
An object represents an entity in the real-world that can be distinctly
identified.
An object consists of identity, state, and behavior.
• Identity: It gives a unique name to an object.
• State: It reflects the properties of an object.
• Behavior: It reflects the response of an object with other objects.
Most read
4
Classes
Class is a template/blue-print for real-world entities
Properties Behavior
• Color
• Cost
• Battery Life
• Make Calls
• Watch Videos
• Play Games
Most read
24
Definitions :
Abstraction is the property by virtue of which only the essential details are
displayed to the user.
Encapsulation is a process of binding data members and member
functions into a single unit. Encapsulation hides the state of a structured
data object inside a class, preventing unauthorized access to an
unauthorized person.
Polymorphism is a Greek word that means many shaped. Polymorphism
is the ability of a message to be displayed in more than one form.
Most read
Python Object Oriented Programming
Ms Smriti Sharma
OOP
Object-oriented programming (OOP) involves programming using objects.
An object represents an entity in the real-world that can be distinctly
identified.
An object consists of identity, state, and behavior.
• Identity: It gives a unique name to an object.
• State: It reflects the properties of an object.
• Behavior: It reflects the response of an object with other objects.
Characteristics of OOPs
• OOPs uses a bottom-up approach.
• The program is divided into objects.
• OOPs uses access modifiers.
• OOPs is more secure than procedural languages.
• Objects can move freely within member functions.
Classes
Class is a template/blue-print for real-world entities
Properties Behavior
• Color
• Cost
• Battery Life
• Make Calls
• Watch Videos
• Play Games
Class in Python
Class is a user-defined data-type
Mobile
int float
bool str
Attributes and Methods
color
cost
Play Game
Make Call
Attributes
Methods
Methods are functions defined
inside a class. They are invoked by
objects to perform actions on other
objects.
Attributes are defined within a
class and outside any method.
Attributes define the
characteristics of any object.
Objects
Objects are specific instances of a class
Apple Samsung
Motorola
Objects in Python
Apple Samsung
Motorola
a = 10 b = 20 c = 30
Specific instances of Mobile data type
Specific instances of integer data type
Creating the first Class
Creating the ‘Phone’ class
Instantiating the ‘p1’ object
Invoking methods through object
Adding parameters to the class
Setting and Returning the
attribute values
Creating a class with Constructor
init method acts as the constructor
__init__ is a method that is
automatically called when
memory is allocated to a new
object.
For invoking in build parameter with object , self is
used .
Instantiating Object
Instantiating the ‘e1’ object
Invoking the
‘employee_details’
method
Inheritance in Python
With inheritance one class can derive the properties of another class
Man inheriting
features from his
father
Inheritance Example
Creating the base class
Instantiating the object for base class
Inheritance Example
Creating the child class
Instantiating the object for child class
Invoking the child class method
Over-riding init method
Over-riding init method
Invoking show_details()
method from parent class Invoking show_car_details()
method from child class
Types of Inheritance
Single Inheritance
Multiple Inheritance
Multi-level Inheritance
Hybrid Inheritance
Multiple Inheritance
Child
Parent 1 Parent 2
In multiple inheritance, the child inherits from more than 1 parent class
Multiple Inheritance in Python
Parent Class One
Parent Class Two
Child Class
Multiple Inheritance in Python
Instantiating object of child class
Invoking methods
Multi-Level Inheritance
Parent
In multi-level Inheritance, we have Parent, child, grand-child relationship
Child
Grand-Child
Multi-Level Inheritance in Python
Parent Class
Child Class
Grand-Child Class
Multi-Level Inheritance in Python
Instantiating object of GrandChild class
Invoking class methods
Definitions :
Abstraction is the property by virtue of which only the essential details are
displayed to the user.
Encapsulation is a process of binding data members and member
functions into a single unit. Encapsulation hides the state of a structured
data object inside a class, preventing unauthorized access to an
unauthorized person.
Polymorphism is a Greek word that means many shaped. Polymorphism
is the ability of a message to be displayed in more than one form.

More Related Content

What's hot (20)

Modules in Python Programming
Modules in Python ProgrammingModules in Python Programming
Modules in Python Programming
sambitmandal
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
Kamal Acharya
 
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
Emertxe Information Technologies Pvt Ltd
 
Functions in python
Functions in pythonFunctions in python
Functions in python
colorsof
 
Python programming : Inheritance and polymorphism
Python programming : Inheritance and polymorphismPython programming : Inheritance and polymorphism
Python programming : Inheritance and polymorphism
Emertxe Information Technologies Pvt Ltd
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
 
Python OOPs
Python OOPsPython OOPs
Python OOPs
Binay Kumar Ray
 
Python Modules
Python ModulesPython Modules
Python Modules
Nitin Reddy Katkam
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
Elewayte
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
 
Python functions
Python functionsPython functions
Python functions
Prof. Dr. K. Adisesha
 
Python-Inheritance.pptx
Python-Inheritance.pptxPython-Inheritance.pptx
Python-Inheritance.pptx
Karudaiyar Ganapathy
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Packages In Python Tutorial
Packages In Python TutorialPackages In Python Tutorial
Packages In Python Tutorial
Simplilearn
 
Python : Data Types
Python : Data TypesPython : Data Types
Python : Data Types
Emertxe Information Technologies Pvt Ltd
 
C++ programming
C++ programmingC++ programming
C++ programming
Emertxe Information Technologies Pvt Ltd
 
Python Generators
Python GeneratorsPython Generators
Python Generators
Akshar Raaj
 
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
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
Nilesh Dalvi
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
baabtra.com - No. 1 supplier of quality freshers
 
Modules in Python Programming
Modules in Python ProgrammingModules in Python Programming
Modules in Python Programming
sambitmandal
 
Functions in python
Functions in pythonFunctions in python
Functions in python
colorsof
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
Elewayte
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Packages In Python Tutorial
Packages In Python TutorialPackages In Python Tutorial
Packages In Python Tutorial
Simplilearn
 
Python Generators
Python GeneratorsPython Generators
Python Generators
Akshar Raaj
 
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
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
Nilesh Dalvi
 

Similar to OOP concepts -in-Python programming language (20)

oops-in-python-240412044200-2d5c6552.pptx
oops-in-python-240412044200-2d5c6552.pptxoops-in-python-240412044200-2d5c6552.pptx
oops-in-python-240412044200-2d5c6552.pptx
anilvarsha1
 
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
 
Problem solving with python programming OOP's Concept
Problem solving with python programming OOP's ConceptProblem solving with python programming OOP's Concept
Problem solving with python programming OOP's Concept
rohitsharma24121
 
Presentation_4516_Content_Document_20250204010703PM.pptx
Presentation_4516_Content_Document_20250204010703PM.pptxPresentation_4516_Content_Document_20250204010703PM.pptx
Presentation_4516_Content_Document_20250204010703PM.pptx
MuhammadChala
 
Introduction to OOP_Python_Lecture1.pptx
Introduction to OOP_Python_Lecture1.pptxIntroduction to OOP_Python_Lecture1.pptx
Introduction to OOP_Python_Lecture1.pptx
cpics
 
Python advance
Python advancePython advance
Python advance
Mukul Kirti Verma
 
OOPS 46 slide Python concepts .pptx
OOPS 46 slide Python concepts       .pptxOOPS 46 slide Python concepts       .pptx
OOPS 46 slide Python concepts .pptx
mrsam3062
 
object oriented programming(PYTHON)
object oriented programming(PYTHON)object oriented programming(PYTHON)
object oriented programming(PYTHON)
Jyoti shukla
 
Lecture # 02 - OOP with Python Language by Muhammad Haroon
Lecture # 02 - OOP with Python Language by Muhammad HaroonLecture # 02 - OOP with Python Language by Muhammad Haroon
Lecture # 02 - OOP with Python Language by Muhammad Haroon
National College of Business Administration & Economics ( NCBA&E)
 
9-_Object_Oriented_Programming_Using_Python 1.pptx
9-_Object_Oriented_Programming_Using_Python 1.pptx9-_Object_Oriented_Programming_Using_Python 1.pptx
9-_Object_Oriented_Programming_Using_Python 1.pptx
Lahari42
 
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
 
Object Oriented programming Using Python.pdf
Object Oriented programming Using Python.pdfObject Oriented programming Using Python.pdf
Object Oriented programming Using Python.pdf
RishuRaj953240
 
9-_Object_Oriented_Programming_Using_Python.pdf
9-_Object_Oriented_Programming_Using_Python.pdf9-_Object_Oriented_Programming_Using_Python.pdf
9-_Object_Oriented_Programming_Using_Python.pdf
anaveenkumar4
 
OOP Concepts Python with code refrences.pptx
OOP Concepts Python with code refrences.pptxOOP Concepts Python with code refrences.pptx
OOP Concepts Python with code refrences.pptx
SofiMusic
 
Object-Oriented Programming in Python.pptx
Object-Oriented Programming in Python.pptxObject-Oriented Programming in Python.pptx
Object-Oriented Programming in Python.pptx
ssuser4ab3a2
 
Python programming computer science and engineering
Python programming computer science and engineeringPython programming computer science and engineering
Python programming computer science and engineering
IRAH34
 
Object-Oriented Programming (OO) in pythonP) in python.pptx
Object-Oriented Programming (OO)  in pythonP)  in python.pptxObject-Oriented Programming (OO)  in pythonP)  in python.pptx
Object-Oriented Programming (OO) in pythonP) in python.pptx
institute of Geoinformatics and Earth Observation at PMAS ARID Agriculture University of Rawalpindi
 
arthimetic operator,classes,objects,instant
arthimetic operator,classes,objects,instantarthimetic operator,classes,objects,instant
arthimetic operator,classes,objects,instant
ssuser77162c
 
OOPS.pptx
OOPS.pptxOOPS.pptx
OOPS.pptx
NitinSharma134320
 
oops-in-python-240412044200-2d5c6552.pptx
oops-in-python-240412044200-2d5c6552.pptxoops-in-python-240412044200-2d5c6552.pptx
oops-in-python-240412044200-2d5c6552.pptx
anilvarsha1
 
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
 
Problem solving with python programming OOP's Concept
Problem solving with python programming OOP's ConceptProblem solving with python programming OOP's Concept
Problem solving with python programming OOP's Concept
rohitsharma24121
 
Presentation_4516_Content_Document_20250204010703PM.pptx
Presentation_4516_Content_Document_20250204010703PM.pptxPresentation_4516_Content_Document_20250204010703PM.pptx
Presentation_4516_Content_Document_20250204010703PM.pptx
MuhammadChala
 
Introduction to OOP_Python_Lecture1.pptx
Introduction to OOP_Python_Lecture1.pptxIntroduction to OOP_Python_Lecture1.pptx
Introduction to OOP_Python_Lecture1.pptx
cpics
 
OOPS 46 slide Python concepts .pptx
OOPS 46 slide Python concepts       .pptxOOPS 46 slide Python concepts       .pptx
OOPS 46 slide Python concepts .pptx
mrsam3062
 
object oriented programming(PYTHON)
object oriented programming(PYTHON)object oriented programming(PYTHON)
object oriented programming(PYTHON)
Jyoti shukla
 
9-_Object_Oriented_Programming_Using_Python 1.pptx
9-_Object_Oriented_Programming_Using_Python 1.pptx9-_Object_Oriented_Programming_Using_Python 1.pptx
9-_Object_Oriented_Programming_Using_Python 1.pptx
Lahari42
 
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
 
Object Oriented programming Using Python.pdf
Object Oriented programming Using Python.pdfObject Oriented programming Using Python.pdf
Object Oriented programming Using Python.pdf
RishuRaj953240
 
9-_Object_Oriented_Programming_Using_Python.pdf
9-_Object_Oriented_Programming_Using_Python.pdf9-_Object_Oriented_Programming_Using_Python.pdf
9-_Object_Oriented_Programming_Using_Python.pdf
anaveenkumar4
 
OOP Concepts Python with code refrences.pptx
OOP Concepts Python with code refrences.pptxOOP Concepts Python with code refrences.pptx
OOP Concepts Python with code refrences.pptx
SofiMusic
 
Object-Oriented Programming in Python.pptx
Object-Oriented Programming in Python.pptxObject-Oriented Programming in Python.pptx
Object-Oriented Programming in Python.pptx
ssuser4ab3a2
 
Python programming computer science and engineering
Python programming computer science and engineeringPython programming computer science and engineering
Python programming computer science and engineering
IRAH34
 
arthimetic operator,classes,objects,instant
arthimetic operator,classes,objects,instantarthimetic operator,classes,objects,instant
arthimetic operator,classes,objects,instant
ssuser77162c
 
Ad

Recently uploaded (20)

Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
BeHappy728244
 
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbbTree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
RATNANITINPATIL
 
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journeyRigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Yannis
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
Presentación Tomografía Axial Computarizada
Presentación Tomografía Axial ComputarizadaPresentación Tomografía Axial Computarizada
Presentación Tomografía Axial Computarizada
Juliana Ovalle Jiménez
 
Electrical and Electronics Engineering: An International Journal (ELELIJ)
Electrical and Electronics Engineering: An International Journal (ELELIJ)Electrical and Electronics Engineering: An International Journal (ELELIJ)
Electrical and Electronics Engineering: An International Journal (ELELIJ)
elelijjournal653
 
Numerical Investigation of the Aerodynamic Characteristics for a Darrieus H-t...
Numerical Investigation of the Aerodynamic Characteristics for a Darrieus H-t...Numerical Investigation of the Aerodynamic Characteristics for a Darrieus H-t...
Numerical Investigation of the Aerodynamic Characteristics for a Darrieus H-t...
Mohamed905031
 
22PCOAM16 _ML_Unit 3 Notes & Question bank
22PCOAM16 _ML_Unit 3 Notes & Question bank22PCOAM16 _ML_Unit 3 Notes & Question bank
22PCOAM16 _ML_Unit 3 Notes & Question bank
Guru Nanak Technical Institutions
 
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptxFINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
kippcam
 
FISICA ESTATICA DESING LOADS CAPITULO 2.
FISICA ESTATICA DESING LOADS CAPITULO 2.FISICA ESTATICA DESING LOADS CAPITULO 2.
FISICA ESTATICA DESING LOADS CAPITULO 2.
maldonadocesarmanuel
 
Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)
pelumiadigun2006
 
Computer_vision-photometric_image_formation.pdf
Computer_vision-photometric_image_formation.pdfComputer_vision-photometric_image_formation.pdf
Computer_vision-photometric_image_formation.pdf
kumarprem6767merp
 
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
Journal of Soft Computing in Civil Engineering
 
Software Developer Portfolio: Backend Architecture & Performance Optimization
Software Developer Portfolio: Backend Architecture & Performance OptimizationSoftware Developer Portfolio: Backend Architecture & Performance Optimization
Software Developer Portfolio: Backend Architecture & Performance Optimization
kiwoong (daniel) kim
 
Research_Sensitization_&_Innovative_Project_Development.pptx
Research_Sensitization_&_Innovative_Project_Development.pptxResearch_Sensitization_&_Innovative_Project_Development.pptx
Research_Sensitization_&_Innovative_Project_Development.pptx
niranjancse
 
International Journal of Advance Robotics & Expert Systems (JARES)
International Journal of Advance Robotics & Expert Systems (JARES)International Journal of Advance Robotics & Expert Systems (JARES)
International Journal of Advance Robotics & Expert Systems (JARES)
jaresjournal868
 
Pruebas y Solucion de problemas empresariales en redes de Fibra Optica
Pruebas y Solucion de problemas empresariales en redes de Fibra OpticaPruebas y Solucion de problemas empresariales en redes de Fibra Optica
Pruebas y Solucion de problemas empresariales en redes de Fibra Optica
OmarAlfredoDelCastil
 
fy06_46f6-ht30_22_oil_gas_industry_guidelines.ppt
fy06_46f6-ht30_22_oil_gas_industry_guidelines.pptfy06_46f6-ht30_22_oil_gas_industry_guidelines.ppt
fy06_46f6-ht30_22_oil_gas_industry_guidelines.ppt
sukarnoamin
 
Irja Straus - Beyond Pass and Fail - DevTalks.pdf
Irja Straus - Beyond Pass and Fail - DevTalks.pdfIrja Straus - Beyond Pass and Fail - DevTalks.pdf
Irja Straus - Beyond Pass and Fail - DevTalks.pdf
Irja Straus
 
Structural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant ConversionStructural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant Conversion
DanielRoman285499
 
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
BeHappy728244
 
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbbTree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
RATNANITINPATIL
 
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journeyRigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Yannis
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
Presentación Tomografía Axial Computarizada
Presentación Tomografía Axial ComputarizadaPresentación Tomografía Axial Computarizada
Presentación Tomografía Axial Computarizada
Juliana Ovalle Jiménez
 
Electrical and Electronics Engineering: An International Journal (ELELIJ)
Electrical and Electronics Engineering: An International Journal (ELELIJ)Electrical and Electronics Engineering: An International Journal (ELELIJ)
Electrical and Electronics Engineering: An International Journal (ELELIJ)
elelijjournal653
 
Numerical Investigation of the Aerodynamic Characteristics for a Darrieus H-t...
Numerical Investigation of the Aerodynamic Characteristics for a Darrieus H-t...Numerical Investigation of the Aerodynamic Characteristics for a Darrieus H-t...
Numerical Investigation of the Aerodynamic Characteristics for a Darrieus H-t...
Mohamed905031
 
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptxFINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
kippcam
 
FISICA ESTATICA DESING LOADS CAPITULO 2.
FISICA ESTATICA DESING LOADS CAPITULO 2.FISICA ESTATICA DESING LOADS CAPITULO 2.
FISICA ESTATICA DESING LOADS CAPITULO 2.
maldonadocesarmanuel
 
Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)Strength of materials (Thermal stress and strain relationships)
Strength of materials (Thermal stress and strain relationships)
pelumiadigun2006
 
Computer_vision-photometric_image_formation.pdf
Computer_vision-photometric_image_formation.pdfComputer_vision-photometric_image_formation.pdf
Computer_vision-photometric_image_formation.pdf
kumarprem6767merp
 
Software Developer Portfolio: Backend Architecture & Performance Optimization
Software Developer Portfolio: Backend Architecture & Performance OptimizationSoftware Developer Portfolio: Backend Architecture & Performance Optimization
Software Developer Portfolio: Backend Architecture & Performance Optimization
kiwoong (daniel) kim
 
Research_Sensitization_&_Innovative_Project_Development.pptx
Research_Sensitization_&_Innovative_Project_Development.pptxResearch_Sensitization_&_Innovative_Project_Development.pptx
Research_Sensitization_&_Innovative_Project_Development.pptx
niranjancse
 
International Journal of Advance Robotics & Expert Systems (JARES)
International Journal of Advance Robotics & Expert Systems (JARES)International Journal of Advance Robotics & Expert Systems (JARES)
International Journal of Advance Robotics & Expert Systems (JARES)
jaresjournal868
 
Pruebas y Solucion de problemas empresariales en redes de Fibra Optica
Pruebas y Solucion de problemas empresariales en redes de Fibra OpticaPruebas y Solucion de problemas empresariales en redes de Fibra Optica
Pruebas y Solucion de problemas empresariales en redes de Fibra Optica
OmarAlfredoDelCastil
 
fy06_46f6-ht30_22_oil_gas_industry_guidelines.ppt
fy06_46f6-ht30_22_oil_gas_industry_guidelines.pptfy06_46f6-ht30_22_oil_gas_industry_guidelines.ppt
fy06_46f6-ht30_22_oil_gas_industry_guidelines.ppt
sukarnoamin
 
Irja Straus - Beyond Pass and Fail - DevTalks.pdf
Irja Straus - Beyond Pass and Fail - DevTalks.pdfIrja Straus - Beyond Pass and Fail - DevTalks.pdf
Irja Straus - Beyond Pass and Fail - DevTalks.pdf
Irja Straus
 
Structural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant ConversionStructural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant Conversion
DanielRoman285499
 
Ad

OOP concepts -in-Python programming language

  • 1. Python Object Oriented Programming Ms Smriti Sharma
  • 2. OOP Object-oriented programming (OOP) involves programming using objects. An object represents an entity in the real-world that can be distinctly identified. An object consists of identity, state, and behavior. • Identity: It gives a unique name to an object. • State: It reflects the properties of an object. • Behavior: It reflects the response of an object with other objects.
  • 3. Characteristics of OOPs • OOPs uses a bottom-up approach. • The program is divided into objects. • OOPs uses access modifiers. • OOPs is more secure than procedural languages. • Objects can move freely within member functions.
  • 4. Classes Class is a template/blue-print for real-world entities Properties Behavior • Color • Cost • Battery Life • Make Calls • Watch Videos • Play Games
  • 5. Class in Python Class is a user-defined data-type Mobile int float bool str
  • 6. Attributes and Methods color cost Play Game Make Call Attributes Methods Methods are functions defined inside a class. They are invoked by objects to perform actions on other objects. Attributes are defined within a class and outside any method. Attributes define the characteristics of any object.
  • 7. Objects Objects are specific instances of a class Apple Samsung Motorola
  • 8. Objects in Python Apple Samsung Motorola a = 10 b = 20 c = 30 Specific instances of Mobile data type Specific instances of integer data type
  • 9. Creating the first Class Creating the ‘Phone’ class Instantiating the ‘p1’ object Invoking methods through object
  • 10. Adding parameters to the class Setting and Returning the attribute values
  • 11. Creating a class with Constructor init method acts as the constructor __init__ is a method that is automatically called when memory is allocated to a new object. For invoking in build parameter with object , self is used .
  • 12. Instantiating Object Instantiating the ‘e1’ object Invoking the ‘employee_details’ method
  • 13. Inheritance in Python With inheritance one class can derive the properties of another class Man inheriting features from his father
  • 14. Inheritance Example Creating the base class Instantiating the object for base class
  • 15. Inheritance Example Creating the child class Instantiating the object for child class Invoking the child class method
  • 16. Over-riding init method Over-riding init method Invoking show_details() method from parent class Invoking show_car_details() method from child class
  • 17. Types of Inheritance Single Inheritance Multiple Inheritance Multi-level Inheritance Hybrid Inheritance
  • 18. Multiple Inheritance Child Parent 1 Parent 2 In multiple inheritance, the child inherits from more than 1 parent class
  • 19. Multiple Inheritance in Python Parent Class One Parent Class Two Child Class
  • 20. Multiple Inheritance in Python Instantiating object of child class Invoking methods
  • 21. Multi-Level Inheritance Parent In multi-level Inheritance, we have Parent, child, grand-child relationship Child Grand-Child
  • 22. Multi-Level Inheritance in Python Parent Class Child Class Grand-Child Class
  • 23. Multi-Level Inheritance in Python Instantiating object of GrandChild class Invoking class methods
  • 24. Definitions : Abstraction is the property by virtue of which only the essential details are displayed to the user. Encapsulation is a process of binding data members and member functions into a single unit. Encapsulation hides the state of a structured data object inside a class, preventing unauthorized access to an unauthorized person. Polymorphism is a Greek word that means many shaped. Polymorphism is the ability of a message to be displayed in more than one form.