CONCEPTS
01Classes and Objects
02The __init__ method
03Instance and Class variables
04Inheritance
05Polymorphism
06Dunder methods
SYNTAX_DEMO
Designing abstractions
class Animal:
def __init__(self, name):
self.name = name
def speak(self):
pass
class Dog(Animal):
def speak(self):
return f"{self.name} says Woof!"
class Cat(Animal):
def speak(self):
return f"{self.name} says Meow!"
dog = Dog("Buddy")
print(dog.speak())