Python super function 🦸

preview_player
Показать описание
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):

class Square(Rectangle):

def __init__(self, length, width):
super().__init__(length,width)

def area(self):

class Cube(Rectangle):

def __init__(self, length, width, height):
super().__init__(length,width)

def volume(self):

square = Square(3, 3)
cube = Cube(3, 3, 3)

Bro Code merch store 👟 :
===========================================================
===========================================================

music credits 🎼 :
===========================================================
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
===========================================================
Рекомендации по теме
Комментарии
Автор

# 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


square = Square(3, 3)
cube = Cube(3, 3, 3)

print(square.area())
print(cube.volume())

BroCodez
Автор

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

kccchiu
Автор

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

Amir_Plays_non_stop
Автор

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

muchossablos
Автор

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

sanjeevKumar-eghp
Автор

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

AzgarD
Автор

This is one of the best explanation about super function

iscoto
Автор

thank you that you learn us the super function

masoudargoshi
Автор

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

Belladonna_khaday
Автор

I appreciate the explanation. Concise and very helpful

chernoboogaloo
Автор

This was the easiest explanation. thank you

imukudzeicharles
Автор

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

kassandrarojass
Автор

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

madushaninimeshika
Автор

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

jahnvisikligar
Автор

Great, straight to the the point video, thanks!

davidhoffman
Автор

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

mohammedu
Автор

This is the clearest explanation video ever!

CodeLife
Автор

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

LAKD
Автор

I really enjoyed the show 🤟
Thanks bro

The-Martian
Автор

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

sauravtiwari