Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion python/ClassOveriding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()