Real-World Polymorphism Example

Mon 10 August 2026
class Notification:
    def send(self):
        print("Sending notification")

class Email(Notification):
    def send(self):
        print("Sending Email")

class SMS(Notification):
    def send(self):
        print("Sending SMS")

def notify(service):
    service.send()

notify(Email())
notify(SMS())
Sending Email
Sending SMS


Score: 10

Category: chapter4_polymorphism