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...
    ===========================================================
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 192

  • @BroCodez
    @BroCodez  3 ปีที่แล้ว +38

    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
      @user-he9ps4ns2z 7 หลายเดือนก่อน

      Is this info available in the full phyton course?

  • @cameron7957
    @cameron7957 2 ปีที่แล้ว +44

    You have no idea how well you just described this. Thank you, much needed.

  • @incognito3923
    @incognito3923 2 ปีที่แล้ว +51

    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
      @medooo80 ปีที่แล้ว +3

      Same for me. I watched python for everybody and didn't learn shit. And this just explained it well. 😂

  • @ronbelanger8812
    @ronbelanger8812 2 ปีที่แล้ว +12

    This is the best programming series I have ever seen. You have a great gift for teaching.

  • @DucTaZenSurfer
    @DucTaZenSurfer 2 ปีที่แล้ว +24

    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!

  • @tara2337
    @tara2337 4 หลายเดือนก่อน +1

    what you do is not teaching, it's more like magic you rock!

  • @happytyagi7122
    @happytyagi7122 หลายเดือนก่อน +1

    Nice 👍

  • @thalesaragao8634
    @thalesaragao8634 2 ปีที่แล้ว +2

    Extremely easy and useful tutorial. I am studying django and a lot of things are just making sense now! Great Content!

  • @francismannion7075
    @francismannion7075 15 วันที่ผ่านมา

    That was great, concise, informative and interesting! Thank you very much.

  • @snoopy962
    @snoopy962 5 หลายเดือนก่อน +1

    Easily and clearly explained. Thanks :)

  • @cameronestrada1430
    @cameronestrada1430 ปีที่แล้ว

    this is the only tutorial that has actually made me understand class inheritance. thank you so much! subscribed 👓

  • @rbtravassos
    @rbtravassos หลายเดือนก่อน

    Very well explained. Thanks ❤

  • @hari3658
    @hari3658 ปีที่แล้ว

    My head was exploding figuring out this whole inheritance problem, thank you so much for being a big brother and saving me.!😭😭

  • @talhaomair1455
    @talhaomair1455 8 หลายเดือนก่อน +1

    This is more useful than the semester worth classes.

  • @kamkam9600
    @kamkam9600 9 หลายเดือนก่อน +1

    Good vid

  • @user-so1dh8et2l
    @user-so1dh8et2l ปีที่แล้ว +1

    Helpful

  • @user-bj9nb7su4j
    @user-bj9nb7su4j 6 หลายเดือนก่อน

    Great tutorial. Enjoy it very much.

  • @gregoriolobato3033
    @gregoriolobato3033 ปีที่แล้ว

    I saw 44 seconds and instant thumb up. Im gonna suscribe.

  • @sarakopser6596
    @sarakopser6596 10 หลายเดือนก่อน

    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!

  • @melanoberidze4995
    @melanoberidze4995 6 หลายเดือนก่อน

    great videoooooo

  • @Budu_Alexandru214
    @Budu_Alexandru214 ปีที่แล้ว

    Nice video

  • @artyomashigov384
    @artyomashigov384 6 หลายเดือนก่อน

    I have subscribed, smashed the like button and leaving this in the comment)
    Great explanation

  • @Michaelthegrape7680
    @Michaelthegrape7680 หลายเดือนก่อน

    That was actually helpful, thanks!

  • @elimoshebogomilsky4592
    @elimoshebogomilsky4592 ปีที่แล้ว

    wow this is so helpful. amazing ability to describe

  • @anikaitpratihary1222
    @anikaitpratihary1222 9 หลายเดือนก่อน

    Bro Lovely 🎉🎉🎉

  • @trshkohamirza1621
    @trshkohamirza1621 หลายเดือนก่อน

    Awesome thank you

  • @knownrobloxian3381
    @knownrobloxian3381 2 ปีที่แล้ว +1

    inheritance seems very helpful

  • @jackkuelmazierlham
    @jackkuelmazierlham 6 หลายเดือนก่อน

    simple explanation, keep it bro

  • @hiiexisthiiexist1284
    @hiiexisthiiexist1284 ปีที่แล้ว

    nice video

  • @centralcodingethiopia
    @centralcodingethiopia ปีที่แล้ว

    Short, brief and to the point.

  • @aydinakbuga
    @aydinakbuga ปีที่แล้ว

    Easy, simple and pratic
    Thanks bro

  • @user-ip1fv3qy2w
    @user-ip1fv3qy2w 4 หลายเดือนก่อน

    You describe this so well

  • @mrrelaxingsounds6894
    @mrrelaxingsounds6894 ปีที่แล้ว

    lovely vid broooooooooooo

  • @utkarshpateriya1564
    @utkarshpateriya1564 7 หลายเดือนก่อน

    Thanks for explaining things in an easy way. Very helpful. Liked and Subscribed

  • @user-ye2mt5xy7f
    @user-ye2mt5xy7f 8 หลายเดือนก่อน

    I like the teaching method

  • @hishamdebis9490
    @hishamdebis9490 3 หลายเดือนก่อน

    awesome

  • @legitimatepsychiatricemerg1363
    @legitimatepsychiatricemerg1363 ปีที่แล้ว

    super nice

  • @istein654
    @istein654 7 หลายเดือนก่อน

    -thank you for this clear explanation!

  • @HannaBerhanu-dj4kz
    @HannaBerhanu-dj4kz 2 หลายเดือนก่อน

    The best lesson ever and you got all the 3 things (like, comment, and Sub)!

  • @cristiucvladimir7909
    @cristiucvladimir7909 3 หลายเดือนก่อน

    Thanks for the content.

  • @samisado6331
    @samisado6331 8 หลายเดือนก่อน

    Thank you so much for the wonderful explanation

  • @ameetfaisal8723
    @ameetfaisal8723 ปีที่แล้ว

    Awesome video. And also commenting for the algorithm.

  • @rethikkrishna777
    @rethikkrishna777 2 หลายเดือนก่อน

    Bro you are awesome

  • @kemann3815
    @kemann3815 2 ปีที่แล้ว

    Great

  • @babaabba9348
    @babaabba9348 7 หลายเดือนก่อน

    Yes I liked the video

  • @bekhacker
    @bekhacker ปีที่แล้ว +1

    Best explanation ever❤

  • @shamaeelahmed3561
    @shamaeelahmed3561 2 ปีที่แล้ว

    Bro, you're the best programming mentor on earth
    Love you

  • @NeoWaiTengTildaTemasekjc
    @NeoWaiTengTildaTemasekjc หลายเดือนก่อน

    i hope you are making lots of money through advertisements, cos you are helping us computing students a lot!!

  • @ninjastar4187
    @ninjastar4187 ปีที่แล้ว

    Smashed 👍🏽and Subscribed ✍🏽 I was going to give up. You broke it down perfectly . Thank you. I'm so grateful.

  • @Pursite
    @Pursite 7 หลายเดือนก่อน

    nice

  • @e-commerceassist4891
    @e-commerceassist4891 ปีที่แล้ว

    I like the concept you taught thanks 🙏

  • @visionlanguages1999
    @visionlanguages1999 6 หลายเดือนก่อน

    you are the best bro!!! I was in serious trouble. You made my day!! Blessings!

  • @marcelobour
    @marcelobour ปีที่แล้ว

    neat as fish+duck!

  • @davehug
    @davehug 3 ปีที่แล้ว +1

    Also thank you for all your work

  • @omarosman5915
    @omarosman5915 6 หลายเดือนก่อน

    bro code is the TRUE BRO 🙌🙌

  • @sirdave48
    @sirdave48 8 หลายเดือนก่อน

    Well explained!

  • @bobthebuilder5434
    @bobthebuilder5434 ปีที่แล้ว

    Actually so good. You explained it in such simple words.

  • @Inte8ranD
    @Inte8ranD 11 หลายเดือนก่อน

    Thank you, @Bro Code

  • @nerdyberi
    @nerdyberi 5 หลายเดือนก่อน

    Very helpful i understood immediately

  • @raidenx_knights1026
    @raidenx_knights1026 5 หลายเดือนก่อน

    This was extremely helpful, thank you

  • @mervesafak1508
    @mervesafak1508 7 หลายเดือนก่อน

    Perfect

  • @juancharlie777
    @juancharlie777 6 หลายเดือนก่อน

    Appreciate you bro

  • @MikeDC360
    @MikeDC360 7 หลายเดือนก่อน

    "Broding 101" keep it coming

  • @davidserrano134
    @davidserrano134 2 ปีที่แล้ว

    I think I found my favorite python channel

  • @badhonbiswas3751
    @badhonbiswas3751 3 ปีที่แล้ว +1

    After watching your opp video i understand the Opp concept

  • @PrinceKMartires
    @PrinceKMartires 4 หลายเดือนก่อน

    Me: putting classes inside classes.

  • @kelvinneiva6635
    @kelvinneiva6635 ปีที่แล้ว

    vc é o brabo, Brasil aqui!!

  • @alsal1002
    @alsal1002 ปีที่แล้ว

    Great Vid!!

  • @09deekshith
    @09deekshith 10 หลายเดือนก่อน

    Best tutorials 🔥🔥🔥🔥

  • @sattamassagan290
    @sattamassagan290 22 วันที่ผ่านมา

    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?

  • @kaiposaldanha1952
    @kaiposaldanha1952 10 วันที่ผ่านมา

    tks bro

  • @XdCassy
    @XdCassy 2 ปีที่แล้ว

    U r way too underrated ty bto

  • @xolelwamabutya-fn2xb
    @xolelwamabutya-fn2xb ปีที่แล้ว

    i was so confused about this topic but now i understand better , thank you !!

    • @zamanincube1368
      @zamanincube1368 4 หลายเดือนก่อน

      Uhlalaphi sisi mhlawumbe singancedana

  • @bu1216
    @bu1216 2 ปีที่แล้ว

    Bro Code is King 👑 of Teaching Programming 👑

  • @imadiman528
    @imadiman528 ปีที่แล้ว

    That's awesome

  • @usatheesh7779
    @usatheesh7779 3 หลายเดือนก่อน

    thank you

  • @lw9954
    @lw9954 2 ปีที่แล้ว

    Thanks for the video Bro

  • @fynzer5421
    @fynzer5421 2 ปีที่แล้ว

    very well explained

  • @huntercraft5674
    @huntercraft5674 ปีที่แล้ว

    nice!

  • @gagandwaz1158
    @gagandwaz1158 2 ปีที่แล้ว

    Awesome! Thanks

  • @lahengsiri4686
    @lahengsiri4686 2 ปีที่แล้ว

    Very clear, very helpfull. Thank you.

  • @kianooshezzatpanah958
    @kianooshezzatpanah958 11 หลายเดือนก่อน

    that was NICEE

  • @gustavoaponte1814
    @gustavoaponte1814 ปีที่แล้ว

    This series is super duper good :3

  • @shortbynaveen
    @shortbynaveen 10 หลายเดือนก่อน

    Amazing bro

  • @Rex_ults
    @Rex_ults 9 หลายเดือนก่อน

    Noice

  • @everythingtv6675
    @everythingtv6675 ปีที่แล้ว

    The best way to explain😂

  • @lotfiaouanouk1292
    @lotfiaouanouk1292 3 ปีที่แล้ว

    great! explanation

  • @DROR19801
    @DROR19801 ปีที่แล้ว

    thank you for this awesome tutorial bro code!

  • @ludwigvangogh4218
    @ludwigvangogh4218 4 หลายเดือนก่อน

    I wish I can inherit your bro-ness by watching these videos

  • @PotatoNachoIT
    @PotatoNachoIT ปีที่แล้ว

    yep defenitly helped thnx rlly man u help a lot of pple

  • @philippseis6893
    @philippseis6893 8 หลายเดือนก่อน

    Perfect, thanks

  • @piotrkopcewicz5227
    @piotrkopcewicz5227 ปีที่แล้ว

    it is good it is very good

  • @faustrare
    @faustrare 3 หลายเดือนก่อน

    💛💛💛

  • @jesuisravi
    @jesuisravi 2 ปีที่แล้ว

    nice job.

  • @aisyjeff95
    @aisyjeff95 2 ปีที่แล้ว

    amazing

  • @user-dj7ic1xs2p
    @user-dj7ic1xs2p ปีที่แล้ว

    I love your coding vids

  • @keemorg3997
    @keemorg3997 ปีที่แล้ว

    Thanks Bro Code!

  • @shirinkhorchid5169
    @shirinkhorchid5169 5 หลายเดือนก่อน

    Thank you ❤

  • @netomusic_br
    @netomusic_br 3 ปีที่แล้ว

    Awesome

  • @techlace1195
    @techlace1195 ปีที่แล้ว

    thanks for super easy explanation bro!