4/6 OOP & Classes in Python: Class Inheritance, Subclasses & Super Function

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

💻 Get my Source Codes and support the channel ❤️:
www.buymeacoffee.com/fabiomus...
⬇️ LEARN ON THE BEST LEARNING PLATFORMS (LINKS BELOW) 😉💪 ⬇️
☕ Buy me a coffee: www.buymeacoffee.com/fabiomus...
😍 One-off donation: www.paypal.me/FabioMusanni/
SKILLSHARE
(Python, Web Dev, UI/UX Design, Music, Art, Animation and a lot more)
🔗 skillshare.eqcm.net/5gxzD2 (Affiliate)
DATACAMP
(Python, ChatGPT, SQL, Power BI, and a lot more)
🔗 datacamp.pxf.io/vN1bDj (Affiliate)
COURSERA PYTHON
(For beginners, Data Science, Data Analysis, AI, Cybersecurity and a lot more):
🔗 imp.i384100.net/k0Nk60 (Affiliate)
COURSERA WEB DEVELOPMENT
(Full Stack, Front-End, Back-End, Web Design and a lot more):
🔗 imp.i384100.net/EKWxBW (Affiliate)
Learn how to create subclasses using inheritance and multiple inheritance and how to use the function super in the _init_ method.
🎥 OOP PLAYLIST: • 🐍 OOP & Classes in Pyt...
🔥 VIDEOS OF THE SERIES
1/6 OOP & Classes: • 1/6 OOP & Classes in P...
2/6 OOP & Classes: • 2/6 OOP & Classes in P...
3/6 OOP & Classes: • 3/6 OOP & Classes in P...
5/6 OOP & Classes: • 5/6 OOP & Classes in P...
6/6 OOP & Classes: • 6/6 OOP & Classes in P...
OOP & Classes Series: • 🐍 OOP & Classes in Pyt...
If the video was helpful, let me know in the comments down below and also like the video so that other people can see it. Needles to say I really appreciate your support 💪❤️
📨 SUBSCRIBE so that you don't miss any new video:
kzread.info...
🤗 BIO PAGE (contacts, etc): solo.to/fabiomusanni
Create Your Bio Page (10% OFF Upgraded Plans 😉): solo.to/inv/NDE4NzE2
🔗 RELATED CONTENT (videos, playlists, etc) 🔗
Python Playlist: • 🐍 Learn Python With Fa...
🤩 AFFILIATE LINKS 🤩
Create Your Bio Page (10% OFF Upgraded Plans): solo.to/inv/NDE4NzE2
🧑🏻‍💻 ABOUT ME 🧑🏻‍💻
I'm Fabio, I started programming with Python a lot of years ago and I fell in love with this world.
I started this KZread channel to help you during your own journey and I hope that my help can make you an amazing programmer who loves this world as I do.
Welcome on board!! 🚀
#pythonWithFabioMusanni #pythonforbeginners #python #pythontutorial #pythonprogramming #coding #programming

Пікірлер: 17

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

    ⬇️ *LEARN ON THE BEST LEARNING PLATFORMS (LINKS BELOW)* 😉💪 ⬇️ ☕ *Buy me a coffee:* www.buymeacoffee.com/fabiomusanni ❤️ *Support me monthly:* www.patreon.com/FabioMusanni 😍 *One-off donation:* www.paypal.me/FabioMusanni/ *SKILLSHARE* _(Python, Web Dev, UI/UX Design, Music, Art, Animation and a lot more)_ 🔗 skillshare.eqcm.net/5gxzD2 (Affiliate) *DATACAMP* _(Python, ChatGPT, SQL, Power BI, and a lot more)_ 🔗 datacamp.pxf.io/vN1bDj (Affiliate) *COURSERA PYTHON* _(For beginners, Data Science, Data Analysis, AI, Cybersecurity and a lot more):_ 🔗 imp.i384100.net/k0Nk60 (Affiliate) *COURSERA WEB DEVELOPMENT* _(Full Stack, Front-End, Back-End, Web Design and a lot more):_ 🔗 imp.i384100.net/EKWxBW (Affiliate) Thank you for the support!❤ 🎥OOP & Classes Playlist: kzread.info/head/PLs8qUrmRvaR2LSaVLSvAGykNexBLrRqNt 🎥All my videos about Python: kzread.info/head/PLs8qUrmRvaR0IT4IwJl-LSweAdACW-yLK

  • @amarmusovic7748
    @amarmusovic7748Ай бұрын

    Thanks for the video!

  • @21pradaofficial4
    @21pradaofficial411 ай бұрын

    thank you for the video, super helpful and straight to the point

  • @FabioMusanni

    @FabioMusanni

    11 ай бұрын

    Thank you so much for taking the time to leave a comment! I'm glad it was helpful 🤩💪

  • @lloyd_talks
    @lloyd_talks6 ай бұрын

    You are the BEST in explaining OOP!! Great playlist 👍🏽

  • @FabioMusanni

    @FabioMusanni

    6 ай бұрын

    Thank you for the comment! I put a lot of effort into making this playlist, so I really appreciate it! 🥹💪 If you want to support the channel just a little bit you can buy me a coffee or get the source code of my videos here: www.buymeacoffee.com/fabiomusanni Thank you again! 🤗

  • @fa7234
    @fa72346 ай бұрын

    Great job Fabio 👍🏼

  • @FabioMusanni

    @FabioMusanni

    6 ай бұрын

    Thank you for the comment! 💪

  • @13bimbou
    @13bimbou2 ай бұрын

    Hi. Thank you for that nice video. At 5:09 i dont get how and why printing "player1.introduction()" works as we dont really call the method. We are "printing" a print and a return statement i don't get how that can print our 2 lines. Thanks for clarifications :-)

  • @FabioMusanni

    @FabioMusanni

    2 ай бұрын

    Thank you for the comment! 😊 Notice that we are also printing on line 28, so when you call introduction, you print the first string, then you call the parent introduction, which returns the second string, and then you return that second string and you print it (line 28). Maybe if we break that down a little more it's easier to understand: def introduction(self): print('Player introduction') second_string = super().introduction() return second_string So on line 28 it's sort of like: print(second_string) Because that's the value returned by the introduction method. Hopefully that's clearer now 😊💪

  • @yeoshuabenzaken7736
    @yeoshuabenzaken77367 ай бұрын

    I can do "Person.__init__(name, age, city) instead of "super().__init__(name, age, city) correct?

  • @FabioMusanni

    @FabioMusanni

    7 ай бұрын

    That would work but you are hard-coding it. You wouldn't have problems if you use that in small programs, but there could be instances where it might cause problems, especially if your code needs to be used by someone else. If I were to choose between using super() or hard-coding the value of the parent, I'd always use super().

  • @yeoshuabenzaken7736

    @yeoshuabenzaken7736

    7 ай бұрын

    Thanks

  • @yeoshuabenzaken7736
    @yeoshuabenzaken77367 ай бұрын

    why in the class player do you need __init__(self, name, age, city, level)shouldn't just be __init__(self,level) because you are bringing the parent class person with "super.(__init__(name,age,city)"?

  • @FabioMusanni

    @FabioMusanni

    7 ай бұрын

    Hello, in this case, if when creating an instance of the class Player, you want to be able to pass name, age, city and level (4 arguments), then you need to have all of them as parameters of the init method of the Player class, If you were to just write (self, level), then when creating the instance, you'd only be able to enter one argument: Player(45) And of course you wouldn't have the name, age and city to then use with super(). It doesn't matter if you are using super() inside the class, Python just sees that when you create an instance of Player, you can enter just 1 argument (level) and nothing else, if you try to enter also name, age and city, you would get an error because you are passing more arguments than expected. That's why you need to have all of them there, even if you are using super(). If this helped and my videos are helpful for you, consider supporting the channel with a little donation, I'd really appreciate it: www.buymeacoffee.com/fabiomusanni

  • @yeoshuabenzaken7736

    @yeoshuabenzaken7736

    7 ай бұрын

    I'll subscribe to your channel@@FabioMusanni

  • @alexikamran7039
    @alexikamran70398 ай бұрын

    you jump very fast not good for new guys. Bad!

Келесі