Python is an object-oriented programming language. This means that almost all the code is implemented using a special construct called classes. A class is a code template for creating objects.
Object-oriented programming is a paradigm centered around the concept of "objects"—self-contained units that combine data and behavior. OOP languages use classes to define the structure and behavior of these objects.
Core Concepts
- Class – A blueprint for creating objects. It defines attributes (data) and methods (functions).
- Object – An instance of a class. Each object can hold unique data and use shared behavior.
- Encapsulation – Bundling data and methods that operate on that data within a single unit (class), and restricting direct access to some components.
- Inheritance – A mechanism where one class can inherit properties and methods from another, promoting code reuse.
- Polymorphism – The ability to use a single interface to represent different underlying forms (data types or classes).
- Abstraction – Hiding complex implementation details and showing only the essential features of an object.
‣
1.0 What is a Class and Objects in Python?
‣
2.0 Create a Class in Python
‣
3.0 Create a Objects in Python
