Object
Introduction to OOP's
Class
Object
Constructor
Instance Variables
Class Variables
Instance Methods
self Keyword
Encapsulation
Public Members
Protected Members
Private Members
Inheritance
Single Inheritance
Multiple Inheritance
Multilevel Inheritance
Hierarchical Inheritance
Hybrid Inheritance
super() Function
Polymorphism
Method Overriding
Duck Typing
Abstraction
Abstract Class
Abstract Method
Class Method
Static Method
Special Methods
_str_ Method
Operator Overloading
Composition
Aggregation
Association
Method Resolution Order
Object Class
issubclass() and isinstance()
Property Decorator
Setter Method with @property
Destructor
Inner Class
Complete Mini Example
Object
2. Object
An object is an instance of a class. Objects use the data and behavior defined in the class.
Syntax
obj = ClassName()
Example
class Car:
brand = "Toyota"
c1 = Car()
print(c1.brand)
Output
Toyota
Example
Executing...
❌ Error:
✅ Output:
// Click Run ▶ to execute