Python inheritance 👪
ฝัง
- เผยแพร่เมื่อ 25 ส.ค. 2024
- Python inheritance tutorial example explained
#python #inheritance #tutorial
class Animal:
alive = True
def eat(self):
print("This animal is eating")
def sleep(self):
print("This animal is sleeping")
class Rabbit(Animal):
def run(self):
print("This rabbit is running")
class Fish(Animal):
def swim(self):
print("This fish is swimming")
class Hawk(Animal):
def fly(self):
print("This hawk is flying")
rabbit = Rabbit()
fish = Fish()
hawk = Hawk()
print(rabbit.alive)
fish.eat()
hawk.sleep()
rabbit.run()
fish.swim()
hawk.fly()
music credits 🎼 :
===========================================================
Up In My Jam (All Of A Sudden) by - Kubbi / kubbi
Creative Commons - Attribution-ShareAlike 3.0 Unported- CC BY-SA 3.0
Free Download / Stream: bit.ly/2JnDfCE
Music promoted by Audio Library • Up In My Jam (All Of A...
=========================================================== - วิทยาศาสตร์และเทคโนโลยี
Don't forget to SMASH that LIKE button and
DROP a random COMMENT down below for the YT algorithm
🙏
also here's the code from the video...
class Animal:
alive = True
def eat(self):
print("This animal is eating")
def sleep(self):
print("This animal is sleeping")
class Rabbit(Animal):
def run(self):
print("This rabbit is running")
class Fish(Animal):
def swim(self):
print("This fish is swimming")
class Hawk(Animal):
def fly(self):
print("This hawk is flying")
rabbit = Rabbit()
fish = Fish()
hawk = Hawk()
print(rabbit.alive)
fish.eat()
hawk.sleep()
rabbit.run()
fish.swim()
hawk.fly()
Is this info available in the full phyton course?
You have no idea how well you just described this. Thank you, much needed.
i watched like 3 videos read 2 books about inheritance listened 1 lecture and learnt nothing. then you came up with 7 minute video and just put knowledge in my brain
Same for me. I watched python for everybody and didn't learn shit. And this just explained it well. 😂
This is the best programming series I have ever seen. You have a great gift for teaching.
Whoa, how on earth can you make me understand inheritance in a 7-minute video but my class of 7 lecture videos couldn't?! lol Good-looking Bro, I always refer to you for learning and in a rut in school during my Python phase. Now we're moving into Phase 2 with Django and Full Dev Stack stuff!
what you do is not teaching, it's more like magic you rock!
Nice 👍
Extremely easy and useful tutorial. I am studying django and a lot of things are just making sense now! Great Content!
That was great, concise, informative and interesting! Thank you very much.
Easily and clearly explained. Thanks :)
this is the only tutorial that has actually made me understand class inheritance. thank you so much! subscribed 👓
Very well explained. Thanks ❤
My head was exploding figuring out this whole inheritance problem, thank you so much for being a big brother and saving me.!😭😭
This is more useful than the semester worth classes.
Good vid
Helpful
Great tutorial. Enjoy it very much.
I saw 44 seconds and instant thumb up. Im gonna suscribe.
Going to school for Cyber Security Management and taking a program class! Professor put this video in resources. I will def save and come back! Thank you for explaining this!
great videoooooo
Nice video
I have subscribed, smashed the like button and leaving this in the comment)
Great explanation
That was actually helpful, thanks!
wow this is so helpful. amazing ability to describe
Bro Lovely 🎉🎉🎉
Awesome thank you
inheritance seems very helpful
simple explanation, keep it bro
nice video
Short, brief and to the point.
Easy, simple and pratic
Thanks bro
You describe this so well
lovely vid broooooooooooo
Thanks for explaining things in an easy way. Very helpful. Liked and Subscribed
I like the teaching method
awesome
super nice
-thank you for this clear explanation!
The best lesson ever and you got all the 3 things (like, comment, and Sub)!
Thanks for the content.
Thank you so much for the wonderful explanation
Awesome video. And also commenting for the algorithm.
Bro you are awesome
Great
Yes I liked the video
Best explanation ever❤
Bro, you're the best programming mentor on earth
Love you
i hope you are making lots of money through advertisements, cos you are helping us computing students a lot!!
Smashed 👍🏽and Subscribed ✍🏽 I was going to give up. You broke it down perfectly . Thank you. I'm so grateful.
nice
I like the concept you taught thanks 🙏
you are the best bro!!! I was in serious trouble. You made my day!! Blessings!
neat as fish+duck!
Also thank you for all your work
bro code is the TRUE BRO 🙌🙌
Well explained!
Actually so good. You explained it in such simple words.
Thank you, @Bro Code
Very helpful i understood immediately
This was extremely helpful, thank you
Perfect
Appreciate you bro
"Broding 101" keep it coming
I think I found my favorite python channel
After watching your opp video i understand the Opp concept
same here
Me: putting classes inside classes.
vc é o brabo, Brasil aqui!!
Great Vid!!
Best tutorials 🔥🔥🔥🔥
Nice, thanks. So we would only initialise if we wanted to list attributes, but because we were focused on methods we didn't have to?
tks bro
U r way too underrated ty bto
i was so confused about this topic but now i understand better , thank you !!
Uhlalaphi sisi mhlawumbe singancedana
Bro Code is King 👑 of Teaching Programming 👑
That's awesome
thank you
Thanks for the video Bro
very well explained
nice!
Awesome! Thanks
Very clear, very helpfull. Thank you.
that was NICEE
This series is super duper good :3
Amazing bro
Noice
The best way to explain😂
great! explanation
thank you for this awesome tutorial bro code!
I wish I can inherit your bro-ness by watching these videos
yep defenitly helped thnx rlly man u help a lot of pple
Perfect, thanks
it is good it is very good
💛💛💛
nice job.
amazing
I love your coding vids
Thanks Bro Code!
Thank you ❤
Awesome
thanks for super easy explanation bro!