OOPS BASICS PDF
OOPS BASICS PDF
data and methods to manipulate that data. Python is a multi-paradigm programming language that
supports OOP. The main concepts of OOP include:
• Class: A blueprint for creating objects. It defines a set of attributes and methods that
the created objects (instances) will have.
• Object: An instance of a class. It is created from a class and can have its own unique
attributes and states.
Inheritance:
• Inheritance allows a class (child class) to inherit attributes and methods from another class
(parent class). This promotes code reusability.
Encapsulation:
• Encapsulation is the bundling of data (attributes) and methods (functions) that operate on
the data into a single unit or class. It restricts direct access to some of the object's
components, which can prevent the accidental modification of data.
• Encapsulation: Hide the internal state and require all interaction to be performed through an
object's methods.