Python method overriding 🙅

preview_player
Показать описание
Python method overriding tutorial example explained

#python #method #override

class Animal:

def eat(self):
print("This animal is eating")

class Rabbit(Animal):

def eat(self):
print("This rabbit is eating a carrot")

rabbit = Rabbit()

Bro Code merch store 👟 :
===========================================================
===========================================================
Рекомендации по теме
Комментарии
Автор

class Animal:

#overriden method
def eat(self):
print("This animal is eating")

class Rabbit(Animal):

#overriding method
def eat(self):
print("This rabbit is eating a carrot")


rabbit = Rabbit()
rabbit.eat()

BroCodez
Автор

Bruh, no other chanel has been able to teach this in depth so quickly and it all makes sense!

emiliocanals
Автор

Amazing tutorial. So many others go through over complex contortions to get the same point across 10min and beyond.

machinimaaquinix
Автор

Every time I look through some exam questions and see something I don't quite remember, bro code got my back 🙌Bro's doing god's work out there

dietpanini
Автор

Congrats bro your channel's growing

deepdaddy
Автор

i have not learnt enough english language, but i understand what you are doing in this video.thank you for lesson

multserial
Автор

liked, commented and i subscribed since the moment i got the opportunity to witness your videos

huntercraft
Автор

so simple and ez to understand. +1 subscriber here

karl
Автор

thank u so much Bro! But I wonder if we are rewriting the method in the child class, why do we need the parent class and the inheritance stuff?

tara
Автор

Thank you so much! Short, clear and simple.

anggonag
Автор

short and easy to understand. thanks again

riceball
Автор

These short tutorials are very ADHD friendly (coming from someone with ADHD). Thank you!

manuela
Автор

Amazing sir.. Sir please try to upload a series in javafx

codewithraiju
Автор

is this the same thing as Overloading?

bigbirdisverysadwereallsad
Автор

Thank you very much for everything, greetings from Quintana Roo

uuhju
Автор

Still commenting on every video I watch to beat the yt algorithm

Amir_Plays_non_stop
Автор

I can’t figure out how to word this in a search.. I’ll try here. I have a program with multiple functions. Sometimes one of the functions gets an error.. the error ends the program….If I get a traceback error, how do I ignore the error and keep the program running?
Edit: I figured it out! Look below in my reply

suomynona