object-oriented programming (OOP) | Python Glossary – Real Python

A programming paradigm that organizes code into objects that contain both data and code.

Overview

Added

March 18, 2026

Subject & domain

coding · object-oriented-programming-oop

Grade range

Grade 8–Grade 12 (Senior)

Page kind

Article

Introduction

Object-Oriented Programming (OOP) Overview

  • Definition: A programming paradigm that organizes code into "objects," which bundle data (properties) and behavior (methods) to mirror real-world entities.
  • Core Components:
    • Objects: Self-contained components representing specific entities.
    • Classes: Blueprints used to create objects.
    • Properties: Data attributes that store details about an object.
    • Methods: Functions that define the behaviors an object can perform.
  • Key Principles:
    • Encapsulation: Hiding internal implementation details and exposing only necessary interfaces.
    • Inheritance: Allowing new classes to derive features from existing ones.
    • Polymorphism: Enabling different objects to utilize the same interface.
    • Modularity: Organizing code into independent, manageable, and logical sections.
  • Benefits: Improves code reuse, scalability, and maintainability.
  • Implementation: In Python, classes are defined using the class keyword, and instances are created by calling the class with specific arguments (e.g., toyota = Car("red", "Toyota", 2010)).

Community reviews

No published reviews yet. Be the first to share your experience.