0% found this document useful (0 votes)
3 views12 pages

OOPS_Python

OOP (Object-Oriented Programming) is a programming paradigm that organizes code into objects derived from classes, enhancing modularity and reusability. Key concepts include classes, which serve as blueprints for objects, and inheritance, which allows derived classes to inherit attributes and methods from base classes. Polymorphism enables objects of different classes to be treated as the same type, allowing for flexible and dynamic method behavior.

Uploaded by

kusumanskusumans
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views12 pages

OOPS_Python

OOP (Object-Oriented Programming) is a programming paradigm that organizes code into objects derived from classes, enhancing modularity and reusability. Key concepts include classes, which serve as blueprints for objects, and inheritance, which allows derived classes to inherit attributes and methods from base classes. Polymorphism enables objects of different classes to be treated as the same type, allowing for flexible and dynamic method behavior.

Uploaded by

kusumanskusumans
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
You are on page 1/ 12

Python OOPs Concepts

What is OOPs

OOPs (Object-Oriented Programming System) is a programming
paradigm that organizes code using objects, which are instances of
classes. It is designed to improve modularity, reusability, and
maintainability of code.

Class
A class is like a blueprint or template for creating objects. It defines
attributes (variables) and methods (functions) that the created objects
will have.
Object:

An object is an instance of a class. It has its own data and can use the
methods defined in the class.
Inheritance
Inheritance is an OOP principle where a child (derived) class
inherits attributes and methods from a parent (base) class.
This promotes code reuse, logical hierarchy, and reduces
redundancy.
Single Inheritance

One child inherits from one parent.

Multiple Inheritance

One child class inherits from more than one parent class.


Multilevel Inheritance
A chain of inheritance — child inherits from parent, and another child inherits from that child.


Hierarchical Inheritance
Multiple child classes inherit from the same parent class.

Hybrid Inheritance
A combination of multiple types (e.g., multiple + multilevel).
Polymorphism

It's is a core concept of object-oriented programming (OOP) that allows
objects of different classes to be treated as if they were objects of the
same class, typically through a common interface or method name.

In simple term, Polymorphism means "many forms" the same function
or method name behaves differently depending on the object that calls
it.

You might also like