Loading lesson path
Python
Classes, objects, constructors, inheritance, and the patterns that make Python code reusable.
OOP stands for Object-Oriented Programming .
Python is an object oriented programming language.
All classes have a built-in method called __init__() , which is always executed when the class is being initiated.
The self parameter is a reference to the current instance of the class.
Properties are variables that belong to a class. They store data for each object created from the class.
Methods are functions that belong to a class. They define the behavior of objects created from the class.
Inheritance allows us to define a class that inherits all the methods and properties from another class.
The word "polymorphism" means "many forms", and in programming it refers to methods/functions/operators with the same name that can be executed on many objects or classes.
Encapsulation is about protecting data inside a class.
An inner class is a class defined inside another class. The inner class can access the properties and methods of the outer class.