Python inheritance 👪
Ғылым және технология
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...
===========================================================
Пікірлер: 188
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()
@user-he9ps4ns2z
6 ай бұрын
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
@medooo80
Жыл бұрын
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!
Extremely easy and useful tutorial. I am studying django and a lot of things are just making sense now! Great Content!
this is the only tutorial that has actually made me understand class inheritance. thank you so much! subscribed 👓
I have subscribed, smashed the like button and leaving this in the comment) Great explanation
Thanks for explaining things in an easy way. Very helpful. Liked and Subscribed
Nice 👍
Easily and clearly explained. Thanks :)
My head was exploding figuring out this whole inheritance problem, thank you so much for being a big brother and saving me.!😭😭
wow this is so helpful. amazing ability to describe
Great tutorial. Enjoy it very much.
Actually so good. You explained it in such simple words.
you are the best bro!!! I was in serious trouble. You made my day!! Blessings!
That was actually helpful, thanks!
Bro, you're the best programming mentor on earth Love you
Easy, simple and pratic Thanks bro
Very clear, very helpfull. Thank you.
great! explanation
Very well explained. Thanks ❤
Thank you so much for the wonderful explanation
I saw 44 seconds and instant thumb up. Im gonna suscribe.
thank you for this awesome tutorial bro code!
Awesome video. And also commenting for the algorithm.
I like the concept you taught thanks 🙏
-thank you for this clear explanation!
Also thank you for all your work
Thanks for the content.
Well explained!
Awesome thank you
Great Vid!!
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!
Short, brief and to the point.
what you do is not teaching, it's more like magic you rock!
This was extremely helpful, thank you
vc é o brabo, Brasil aqui!!
thanks for super easy explanation bro!
Smashed 👍🏽and Subscribed ✍🏽 I was going to give up. You broke it down perfectly . Thank you. I'm so grateful.
Awesome! Thanks
very well explained
neat as fish+duck!
Thanks for the video Bro
lovely vid broooooooooooo
Best explanation ever❤
Very helpful i understood immediately
simple explanation, keep it bro
Bro you are awesome
yep defenitly helped thnx rlly man u help a lot of pple
Helpful !
This series is super duper good :3
great videoooooo
inheritance seems very helpful
super nice
Good vid
Excellent Bro
Helpful
thx 4 vid bro !
Amazing bro
nice job.
That's awesome
Best tutorials 🔥🔥🔥🔥
Bro Lovely 🎉🎉🎉
Appreciate you bro
nice!
You describe this so well
Wow!
I think I found my favorite python channel
This is more useful than the semester worth classes.
that was NICEE
Thanks Bro Code!
nice video
Comment for the algo. Good video, man.
awesome
Nice video
this is so good
Thank You so much!
Perfect, thanks
I like the teaching method
Thank you, @Bro Code
Thanks!
Perfect
amazing
Great
The best lesson ever and you got all the 3 things (like, comment, and Sub)!
Bro Code is King 👑 of Teaching Programming 👑
Awesome
bro code is the TRUE BRO 🙌🙌
U r way too underrated ty bto
nice
i was so confused about this topic but now i understand better , thank you !!
@zamanincube1368
3 ай бұрын
Uhlalaphi sisi mhlawumbe singancedana
Thanks a lot Bro
thanks!
it is good it is very good
thank you
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?
Thanks,bro
Thanks bro!
Thank you ❤