diff --git a/python/ClassOveriding.py b/python/ClassOveriding.py index 1b356b7..a7e6b97 100644 --- a/python/ClassOveriding.py +++ b/python/ClassOveriding.py @@ -16,4 +16,25 @@ def make_sound(self): my_animal.make_sound() my_dog.make_sound() -my_cat.make_sound() +my_cat.make_sound() + + +class car: + def make_sound(self): + print("Some sound") + +class tata(car): + def make_sound(self): + print("Bark") + +class toyato(car): + def make_sound(self): + print("Meow") + +my_cars = car() +my_tata = tata() +my_toyato = toyato() + +my_cars.make_sound() +my_tata.make_sound() +my_toyato.make_sound()