2
Most read
4
Most read
9
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

PPTX
Basics of Object Oriented Programming in Python
PPTX
Object Oriented Programming in Python
PPTX
Object oriented programming in python
PPTX
Class, object and inheritance in python
PPTX
Python-Classes.pptx
PDF
Object oriented approach in python programming
PPTX
Python-Encapsulation.pptx
Basics of Object Oriented Programming in Python
Object Oriented Programming in Python
Object oriented programming in python
Class, object and inheritance in python
Python-Classes.pptx
Object oriented approach in python programming
Python-Encapsulation.pptx

What's hot (20)

PPTX
Modules in Python Programming
PPTX
Chapter 07 inheritance
PDF
Python programming : Files
PPT
Object-oriented concepts
PPTX
CLASS OBJECT AND INHERITANCE IN PYTHON
PPTX
Constructor in java
PDF
List,tuple,dictionary
PPTX
Pointers in c++
PPSX
Modules and packages in python
PDF
Python file handling
PPTX
Data types in python
PDF
Python programming : Classes objects
PPTX
Python Functions
PPTX
Chapter 05 classes and objects
PPTX
Data types in java
PPTX
Procedural vs. object oriented programming
PPT
Class and object in C++
PPTX
Classes objects in java
PPTX
Interface in java
PPTX
Polymorphism presentation in java
Modules in Python Programming
Chapter 07 inheritance
Python programming : Files
Object-oriented concepts
CLASS OBJECT AND INHERITANCE IN PYTHON
Constructor in java
List,tuple,dictionary
Pointers in c++
Modules and packages in python
Python file handling
Data types in python
Python programming : Classes objects
Python Functions
Chapter 05 classes and objects
Data types in java
Procedural vs. object oriented programming
Class and object in C++
Classes objects in java
Interface in java
Polymorphism presentation in java
Ad

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

PPTX
oops-in-python-240412044200-2d5c6552.pptx
PPTX
Class and Objects in python programming.pptx
PDF
Unit 3-Classes ,Objects and Inheritance.pdf
PPTX
Problem solving with python programming OOP's Concept
PPTX
Presentation_4516_Content_Document_20250204010703PM.pptx
PPTX
Introduction to OOP_Python_Lecture1.pptx
PPTX
Python advance
PPTX
OOPS 46 slide Python concepts .pptx
PPTX
object oriented programming(PYTHON)
PDF
Lecture # 02 - OOP with Python Language by Muhammad Haroon
PPTX
9-_Object_Oriented_Programming_Using_Python 1.pptx
PPTX
Object Oriented Programming.pptx
PDF
Object-Oriented Programming System presentation
PDF
Object Oriented programming Using Python.pdf
PDF
9-_Object_Oriented_Programming_Using_Python.pdf
PPTX
OOP Concepts Python with code refrences.pptx
PPTX
Object-Oriented Programming in Python.pptx
PPTX
Python programming computer science and engineering
PPTX
arthimetic operator,classes,objects,instant
oops-in-python-240412044200-2d5c6552.pptx
Class and Objects in python programming.pptx
Unit 3-Classes ,Objects and Inheritance.pdf
Problem solving with python programming OOP's Concept
Presentation_4516_Content_Document_20250204010703PM.pptx
Introduction to OOP_Python_Lecture1.pptx
Python advance
OOPS 46 slide Python concepts .pptx
object oriented programming(PYTHON)
Lecture # 02 - OOP with Python Language by Muhammad Haroon
9-_Object_Oriented_Programming_Using_Python 1.pptx
Object Oriented Programming.pptx
Object-Oriented Programming System presentation
Object Oriented programming Using Python.pdf
9-_Object_Oriented_Programming_Using_Python.pdf
OOP Concepts Python with code refrences.pptx
Object-Oriented Programming in Python.pptx
Python programming computer science and engineering
arthimetic operator,classes,objects,instant
Ad

Recently uploaded (20)

PDF
IAE-V2500 Engine Airbus Family A319/320
PDF
25AF1191PC303 MODULE-1 CHAIN SURVEYING SEMESTER III SURVEYING
PPTX
SE unit 1.pptx by d.y.p.akurdi aaaaaaaaaaaa
PPTX
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
PPTX
DATA STRCUTURE LABORATORY -BCSL305(PRG1)
PDF
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
PDF
Mechanics of materials week 2 rajeshwari
DOCX
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
PPTX
chapter 1.pptx dotnet technology introduction
PPT
Unit - I.lathemachnespct=ificationsand ppt
PDF
Module 1 part 1.pdf engineering notes s7
PDF
Introduction to Machine Learning -Basic concepts,Models and Description
PDF
THE PEDAGOGICAL NEXUS IN TEACHING ELECTRICITY CONCEPTS IN THE GRADE 9 NATURAL...
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PDF
V2500 Owner and Operatore Guide for Airbus
PDF
ST MNCWANGO P2 WIL (MEPR302) FINAL REPORT.pdf
PPTX
quantum theory on the next future in.pptx
PPTX
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
PDF
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
PDF
Using Technology to Foster Innovative Teaching Practices (www.kiu.ac.ug)
IAE-V2500 Engine Airbus Family A319/320
25AF1191PC303 MODULE-1 CHAIN SURVEYING SEMESTER III SURVEYING
SE unit 1.pptx by d.y.p.akurdi aaaaaaaaaaaa
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
DATA STRCUTURE LABORATORY -BCSL305(PRG1)
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
Mechanics of materials week 2 rajeshwari
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
chapter 1.pptx dotnet technology introduction
Unit - I.lathemachnespct=ificationsand ppt
Module 1 part 1.pdf engineering notes s7
Introduction to Machine Learning -Basic concepts,Models and Description
THE PEDAGOGICAL NEXUS IN TEACHING ELECTRICITY CONCEPTS IN THE GRADE 9 NATURAL...
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
V2500 Owner and Operatore Guide for Airbus
ST MNCWANGO P2 WIL (MEPR302) FINAL REPORT.pdf
quantum theory on the next future in.pptx
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
Using Technology to Foster Innovative Teaching Practices (www.kiu.ac.ug)

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.