OOPs Concepts
OOPs are nothing but a programming paradigm that provides a structure for programs, so the properties and behavior are bundled into individual "Objects".
Class
class Dog:
species = "German shepherd" ## class attribute
def __init__(self, name, breed):
self.name = name ## object attribute
self.breed = breed ## object attribute
def bark(self): ## object method
print(f"{self.name} says woof!")
dog1 = Dog("tommy","dalmatian") ## Object creation
print(dog1.bark()) ## Object calling class method
## ====== output =============
## tommy says woof!Inheritance
Encapsulation
Polymorphism
Data Abstraction
@staticmethod
@staticmethod@classmethod
@classmethodsuper()
super()Method Resolution Order (MRO)
Dunder (Magic) Methods
Composition vs Inheritance
Operator Overloading
Shallow Copy Vs Deep Copy

Last updated
