Python super function 🦸

Ғылым және технология

python super function tutorial example explained
#python #super #super()
super() = Function used to give access to the methods of a parent class.
Returns a temporary object of a parent class when used
class Rectangle:
def __init__(self, length, width):
self.length = length
self.width = width
class Square(Rectangle):
def __init__(self, length, width):
super().__init__(length,width)
def area(self):
return self.length*self.width
class Cube(Rectangle):
def __init__(self, length, width, height):
super().__init__(length,width)
self.height = height
def volume(self):
return self.length*self.width*self.height
square = Square(3, 3)
cube = Cube(3, 3, 3)
print(square.area())
print(cube.volume())
Bro Code merch store 👟 :
===========================================================
teespring.com/stores/bro-code-5
===========================================================
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...
===========================================================

Пікірлер: 229

  • @BroCodez
    @BroCodez3 жыл бұрын

    # super() = Function used to give access to the methods of a parent class. # Returns a temporary object of a parent class when used class Rectangle: def __init__(self, length, width): self.length = length self.width = width class Square(Rectangle): def __init__(self, length, width): super().__init__(length,width) def area(self): return self.length*self.width class Cube(Rectangle): def __init__(self, length, width, height): super().__init__(length,width) self.height = height def volume(self): return self.length*self.width*self.height square = Square(3, 3) cube = Cube(3, 3, 3) print(square.area()) print(cube.volume())

  • @kccchiu
    @kccchiu2 жыл бұрын

    Straight to the point. A perfect example to explain the function. Thanks!

  • @muchossablos
    @muchossablos3 жыл бұрын

    You've got the perfect learning curve. Give us a step forward, and public more advanced topics, at this pace.

  • @Amir_Plays_non_stop
    @Amir_Plays_non_stop3 жыл бұрын

    I would like if you do videos where u work on a specific project so we can learn more advance about python.

  • @BroCodez

    @BroCodez

    3 жыл бұрын

    Thanks for the suggestion! I'll look into that!

  • @sanjeevKumar-eg6hp
    @sanjeevKumar-eg6hp11 ай бұрын

    This is an awesome video. To point and precise explanation no BS. Thanks for the knowledge. Appreciate the time and effort in making it such a simple video

  • @Drew_League_95
    @Drew_League_952 жыл бұрын

    Super easy to grasp the concept. Thank you, and keep up the good work! :)

  • @samster1004
    @samster1004 Жыл бұрын

    well explained and with a nice simple example. You've got a new subscriber

  • @mohammed09u32
    @mohammed09u3210 ай бұрын

    WOW! You were amazing I watched many tutorials and never understood how super() works until I watched your video. I will share your channel with my colleagues, keep going.....

  • @LucyHealthy97
    @LucyHealthy972 жыл бұрын

    Your video is really helpful! Thank you so much, hope you can do more videos like this

  • @Arun-jc3pf
    @Arun-jc3pf Жыл бұрын

    Appreciate the vids man!

  • @KarolinaRiddle111
    @KarolinaRiddle1112 жыл бұрын

    I like the way you teaching. Everything is very clearly explained. :)

  • @jahnvisikligar7397
    @jahnvisikligar7397 Жыл бұрын

    the explanation of super() was very concise to the point. it cleared my doubts very well. loved this!!!!

  • @theeox
    @theeox2 жыл бұрын

    That was very helpful. I find I learn new things everyday and this was no exception. Thanks!

  • @kassandrarojass
    @kassandrarojass10 ай бұрын

    This was exactly what I needed-- Thank you for this!!

  • @Yazan_Majdalawi
    @Yazan_Majdalawi3 жыл бұрын

    I'm happy I'm here in this channel this early... Subscribed 💗

  • @Branables
    @Branables2 жыл бұрын

    Very succinct and very useful. Thanks for the explanation!

  • @AzgarD555
    @AzgarD5553 жыл бұрын

    This channel should get more view's, you always help me with something I never understanded super classes, but now i do, thanks :)

  • @1234bellamy

    @1234bellamy

    2 ай бұрын

    No wayyyy, you're a Yxngxr1 fan and a programmer too? #Rare.

  • @iscoto4914
    @iscoto49142 жыл бұрын

    This is one of the best explanation about super function

  • @sauravtiwari3750
    @sauravtiwari37502 жыл бұрын

    you made it simple broo jjust subscribed keep it upp thumbs upp

  • @yejinrhee4576
    @yejinrhee45762 жыл бұрын

    love a to z of ur video! thx :)

  • @raygames5636
    @raygames5636 Жыл бұрын

    Damn, bro, this is the best explanation of super function! Thanks a lot!

  • @chalkypj
    @chalkypj10 ай бұрын

    Great video. You explained it in a simple easy to understand way. I'm new to python coding and I used the super function to add additional functionality to an update function in a child class by calling the super().update() function in the first line of a child's update function.

  • @madushaninimeshika3910
    @madushaninimeshika3910 Жыл бұрын

    A very good explanation..thank you very much....

  • @michellegutierrez4690
    @michellegutierrez46903 жыл бұрын

    Thank you! You explained helped me to understand it

  • @rottenapple7373
    @rottenapple73732 жыл бұрын

    Thank you for using Rectangles. That helped me plug in your info much easier!!!

  • @davidhoffman676
    @davidhoffman6767 ай бұрын

    Great, straight to the the point video, thanks!

  • @The-Martian73
    @The-Martian73 Жыл бұрын

    I really enjoyed the show 🤟 Thanks bro

  • @williepietersen4707
    @williepietersen47077 ай бұрын

    Very well explained. Thanks a lot.

  • @mArjunyadav
    @mArjunyadav2 жыл бұрын

    Great ,short and crisp

  • @Code4Life400
    @Code4Life4005 ай бұрын

    This is the clearest explanation video ever!

  • @mannnanshaikh7608
    @mannnanshaikh76082 жыл бұрын

    u are the best teacher i have in my life. thank you so much and i appriciate ur time and work very much. stay safe and healthy brother . peace

  • @dzieckodisneychannel
    @dzieckodisneychannel2 жыл бұрын

    Quick and easy explanation, thank you :)

  • @kinjalkumar1900
    @kinjalkumar1900 Жыл бұрын

    Thanks for explaining it in such an easy way broo.....

  • @aashayamballi
    @aashayamballi3 жыл бұрын

    thank you for the clear explanation! :)

  • @HubertRozmarynowski
    @HubertRozmarynowski2 жыл бұрын

    Thank you Mr. Bro Code, this was very helpful.

  • @BomDia.Filho_
    @BomDia.Filho_2 жыл бұрын

    simple and very well explained, thanks!

  • @innovatornag1398
    @innovatornag139810 ай бұрын

    Nice Explanation.Thanks

  • @nemesai1985
    @nemesai1985 Жыл бұрын

    Cool explanation.

  • @Go_Pr0
    @Go_Pr023 күн бұрын

    I liked your video, thanks!

  • @qinzideng9270
    @qinzideng9270 Жыл бұрын

    Very helpful! thanks

  • @ammarshahzad9627
    @ammarshahzad9627 Жыл бұрын

    perfect, straight to the point, Thank you

  • @danirismagilov5248
    @danirismagilov5248 Жыл бұрын

    Thanks for useful information!

  • @px0736
    @px073611 ай бұрын

    Thanks bro! I appreciate your contribution 👊

  • @winter8476
    @winter84762 жыл бұрын

    1st the seeing this channel.... the name plus the explanation is 10/10

  • @work9167
    @work91672 жыл бұрын

    This video about super function is just super, bro!

  • @mahendrasonawane224
    @mahendrasonawane224 Жыл бұрын

    Easy to understand...!!!

  • @mopz3985
    @mopz39852 жыл бұрын

    Thanks for a good video. I can see clearly now :)

  • @khaleddawoud363
    @khaleddawoud3632 жыл бұрын

    well explained. Thank you

  • @imukudzeicharles2960
    @imukudzeicharles29606 ай бұрын

    This was the easiest explanation. thank you

  • @9042jeremy
    @9042jeremy2 жыл бұрын

    Thanks, Bro Code, very clear explanations. A quick question: what is the motivation for passing the class Rectangle to the __init__ method for square and cube, versus having a Rectangle instance passed to them?

  • @masoudargoshi4312
    @masoudargoshi4312 Жыл бұрын

    thank you that you learn us the super function

  • @mojtabamonfared4751
    @mojtabamonfared47512 жыл бұрын

    super() helpful! thank you

  • @aliakhavan6553
    @aliakhavan65532 жыл бұрын

    it was so helpful thanks bro

  • @visionlanguages1999
    @visionlanguages199910 ай бұрын

    you are the man !! Thx!!

  • @alexlavertyau
    @alexlavertyau Жыл бұрын

    finally found a video with explanation of super that i understand thanks!

  • @vasildimitrov7251
    @vasildimitrov72515 ай бұрын

    Really helpful !

  • @Belladonna_khaday
    @Belladonna_khaday18 күн бұрын

    Bro Code is my best programming teacher. Thank you so much for this lesson❤❤❤❤

  • @dineshgautam7027
    @dineshgautam70273 жыл бұрын

    Great....... Bro....

  • @gokulkrishnan4721
    @gokulkrishnan47212 жыл бұрын

    Awesome need some project based OOPS approach🥰 love from 🇮🇳❣️

  • @RA-bo9cl
    @RA-bo9cl3 жыл бұрын

    yea, you really help me. Thank you

  • @Unknown-ki8yk
    @Unknown-ki8yk2 жыл бұрын

    I used it for the first time in a job assessment, I wanted to make sure that if I used it correctly, and yes it was correct. Thanks, Bro

  • @dildoranutfieva9632
    @dildoranutfieva96322 жыл бұрын

    Man I watched 4 tutorial about super(). But you were the only one who could explain. print("You're a good man")

  • @EissaAlahdul
    @EissaAlahdul2 жыл бұрын

    Thanks you a lot

  • @moukaloka9543
    @moukaloka95433 жыл бұрын

    super explanation !!!

  • @nadew.02
    @nadew.02 Жыл бұрын

    Thank you so much

  • @naveengoyal5243
    @naveengoyal52433 жыл бұрын

    Simply awesome

  • @Sugardadfps
    @Sugardadfps Жыл бұрын

    Thanks! Easy to digest!

  • @altayezekariyas9243
    @altayezekariyas92432 жыл бұрын

    i came here from another tutorial, just to understand what the super class was and i liked ur content

  • @DMcDonald14
    @DMcDonald142 жыл бұрын

    Awesome Bro thanks

  • @VworksArt
    @VworksArt2 жыл бұрын

    Thank you friend

  • @yahya-ke4ef
    @yahya-ke4ef2 жыл бұрын

    thank you. that was clear

  • @paantur
    @paantur Жыл бұрын

    Great explanation

  • @bluesdog88
    @bluesdog883 жыл бұрын

    Thanks for the explanation, taking a long time to get my head around classes, probably because i haven't used them in any of the simple programs I have written. Just about to learn Java in a uni class, is there a good process for understanding program design, as in what to use where i seem to be getting very lost there. I guess that's basic program design that comes before anything like data structures and algorithms, should i be reading more about object oriented programming in general?

  • @rahulunniyampath7129
    @rahulunniyampath71296 ай бұрын

    needed this!

  • @LAKD
    @LAKD Жыл бұрын

    I hate when I see videos that are 15 minutes, when it can clearly be explained in 5 minutes or less. Thanks!

  • @qwertymegaforce9088
    @qwertymegaforce90882 ай бұрын

    Short and simple! What a Gigachad!

  • @expectations2188
    @expectations21882 жыл бұрын

    awesome tutorial

  • @robertomanrique8004
    @robertomanrique80042 жыл бұрын

    great help bro!

  • @samirlehaff
    @samirlehaff9 ай бұрын

    That was Super !!!!!!

  • @yellowbannana8989
    @yellowbannana89892 жыл бұрын

    thx this helped a lot, we can also use *args to not repeat specifying params

  • @yasinsherif8875
    @yasinsherif8875 Жыл бұрын

    Thanku brother

  • @burakkaymaz9233
    @burakkaymaz9233 Жыл бұрын

    thank oyu so much

  • @krishnalakhi533
    @krishnalakhi5333 жыл бұрын

    Good stuff buddy !

  • @Santa9204
    @Santa920411 ай бұрын

    Nicely done. Subscribed

  • @shubhojeetghosh9694
    @shubhojeetghosh96949 ай бұрын

    Thankyou🎉

  • @Tete92378
    @Tete923782 жыл бұрын

    Brilliant!!!

  • @rishi4418
    @rishi44182 жыл бұрын

    Thanks bro 😊 perfecto

  • @Abdullah_hassan_88
    @Abdullah_hassan_88 Жыл бұрын

    Thanks bro

  • @srali7609
    @srali76092 жыл бұрын

    fantastic explanation

  • @rostislavmalyshev1775
    @rostislavmalyshev17752 жыл бұрын

    Thanks!

  • @henriquefelinimena7433
    @henriquefelinimena74333 жыл бұрын

    Thank you Bro!

  • @mostafaghobashy2724
    @mostafaghobashy2724 Жыл бұрын

    great vid

  • @y.nicole3653
    @y.nicole36533 жыл бұрын

    thank you :)

  • @artorias7224
    @artorias7224 Жыл бұрын

    YOU SAVED MY LIFE THANK YOU

  • @nicobonora4093
    @nicobonora40933 жыл бұрын

    nice one dude!

  • @PeritoProducciones
    @PeritoProducciones11 ай бұрын

    Thank you, bro.

  • @lw9954
    @lw9954 Жыл бұрын

    Nice video bro.

  • @spooky_arctic
    @spooky_arctic2 жыл бұрын

    THANK YOU

  • @beingzero7541
    @beingzero75412 жыл бұрын

    Wow!

  • @tarikyassa1076
    @tarikyassa10763 жыл бұрын

    Thanks Bro!

Келесі