Python, Oop, Programming, Technology, Software Development.
be implemented by subclasses. from abc import ABC, abstractmethod class Animal(ABC): @abstractmethod def speak(self): pass class Dog(Animal): def speak(self): return "Bark!" class Cat(Animal): def speak(self): return "Meow!" # Create instances of Dog and Cat dog = Dog() cat = Cat() # Call the speak