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
# 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())
Straight to the point. A perfect example to explain the function. Thanks!
You've got the perfect learning curve. Give us a step forward, and public more advanced topics, at this pace.
I would like if you do videos where u work on a specific project so we can learn more advance about python.
@BroCodez
3 жыл бұрын
Thanks for the suggestion! I'll look into that!
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
Super easy to grasp the concept. Thank you, and keep up the good work! :)
well explained and with a nice simple example. You've got a new subscriber
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.....
Your video is really helpful! Thank you so much, hope you can do more videos like this
Appreciate the vids man!
I like the way you teaching. Everything is very clearly explained. :)
the explanation of super() was very concise to the point. it cleared my doubts very well. loved this!!!!
That was very helpful. I find I learn new things everyday and this was no exception. Thanks!
This was exactly what I needed-- Thank you for this!!
I'm happy I'm here in this channel this early... Subscribed 💗
Very succinct and very useful. Thanks for the explanation!
This channel should get more view's, you always help me with something I never understanded super classes, but now i do, thanks :)
@1234bellamy
2 ай бұрын
No wayyyy, you're a Yxngxr1 fan and a programmer too? #Rare.
This is one of the best explanation about super function
you made it simple broo jjust subscribed keep it upp thumbs upp
love a to z of ur video! thx :)
Damn, bro, this is the best explanation of super function! Thanks a lot!
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.
A very good explanation..thank you very much....
Thank you! You explained helped me to understand it
Thank you for using Rectangles. That helped me plug in your info much easier!!!
Great, straight to the the point video, thanks!
I really enjoyed the show 🤟 Thanks bro
Very well explained. Thanks a lot.
Great ,short and crisp
This is the clearest explanation video ever!
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
Quick and easy explanation, thank you :)
Thanks for explaining it in such an easy way broo.....
thank you for the clear explanation! :)
Thank you Mr. Bro Code, this was very helpful.
simple and very well explained, thanks!
Nice Explanation.Thanks
Cool explanation.
I liked your video, thanks!
Very helpful! thanks
perfect, straight to the point, Thank you
Thanks for useful information!
Thanks bro! I appreciate your contribution 👊
1st the seeing this channel.... the name plus the explanation is 10/10
This video about super function is just super, bro!
Easy to understand...!!!
Thanks for a good video. I can see clearly now :)
well explained. Thank you
This was the easiest explanation. thank you
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?
thank you that you learn us the super function
super() helpful! thank you
it was so helpful thanks bro
you are the man !! Thx!!
finally found a video with explanation of super that i understand thanks!
Really helpful !
Bro Code is my best programming teacher. Thank you so much for this lesson❤❤❤❤
Great....... Bro....
Awesome need some project based OOPS approach🥰 love from 🇮🇳❣️
yea, you really help me. Thank you
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
Man I watched 4 tutorial about super(). But you were the only one who could explain. print("You're a good man")
Thanks you a lot
super explanation !!!
Thank you so much
Simply awesome
Thanks! Easy to digest!
i came here from another tutorial, just to understand what the super class was and i liked ur content
Awesome Bro thanks
Thank you friend
thank you. that was clear
Great explanation
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?
needed this!
I hate when I see videos that are 15 minutes, when it can clearly be explained in 5 minutes or less. Thanks!
Short and simple! What a Gigachad!
awesome tutorial
great help bro!
That was Super !!!!!!
thx this helped a lot, we can also use *args to not repeat specifying params
Thanku brother
thank oyu so much
Good stuff buddy !
Nicely done. Subscribed
Thankyou🎉
Brilliant!!!
Thanks bro 😊 perfecto
Thanks bro
fantastic explanation
Thanks!
Thank you Bro!
great vid
thank you :)
YOU SAVED MY LIFE THANK YOU
nice one dude!
Thank you, bro.
Nice video bro.
THANK YOU
Wow!
Thanks Bro!