OOP Class Inheritance and Private Class Members - Python for Beginners!

  Рет қаралды 119,036

Python Simplified

Python Simplified

Күн бұрын

Hi everyone! today we will do a quick classes and objects exercise!
We will practice everything we've learned in previous tutorials and we will also talk about:
🐍 class inheritance
🐍 private class members... and why they're not exactly private in Python 😅
🐍 in the very end - tips of how to avoid repetition!
In our exercise - we own a guitar store and we need to find a way to keep track of our inventory.
So through a variety of real-life examples, we will discover all the qualities of classes along with their significance!
You can either follow along in your IDE or you can:
⭐ Clone My Tutorial Code ⭐
* Sorry code is unavailable, RIP Wayscript 😭😭😭*
If you have any questions - please leave me a comment below and I'd love to help! 😊
🛑 PREVIOUS TUTORIALS 🛑
_____________________________
⭐ Objects and Classes for Beginners:
• Python Classes and Obj...
⭐ Forest of Objects OpenCV Exercise:
• Draw a Forest of Rando...
⌚ TIME STAMPS ⌚
_____________________________
00:00 - intro
00:22 - init method
00:35 - attributes
01:26 - methods
01:49 - function vs method
02:57 - call method on object
03:13 - call method inside init
04:02 - class inheritance
05:09 - parent and child classes
06:15 - child methods
07:02 - replace child attributes
09:04 - private members
10:14 - bypass private members
11:42 - private methods
13:01 - tips to avoid repetition
15:52 - thanks for watching!
🙏 THANKS FOR WATCHING 🙏

Пікірлер: 284
@Kiteboarding316
@Kiteboarding316 2 жыл бұрын
I'll be honest I thought she was classic click bait: hot chick + interesting topic = views, but she does break down the core concepts in an easy and engaging way.
@PythonSimplified
@PythonSimplified 2 жыл бұрын
hahahaha thank you so much Design! 😁 I'm super happy you liked this tutorial and even happier to see you summarized the entire purpose of this channel in one sentence! 😀😀😀 Trying to take some difficult concepts and make them approachable for everyone, so thank you so much for your lovely comment!
@wesleyphon508
@wesleyphon508 Ай бұрын
can this be simply with dataclass or even pydantic -hmmm
@wesleyphon508
@wesleyphon508 Ай бұрын
simplfy
@wesleyphon508
@wesleyphon508 Ай бұрын
simplify - sorry my key get stuck
@TomkinsOkello
@TomkinsOkello 2 жыл бұрын
You present complex programming topics in an easier way so much so that newbies understand the concepts explained.
@PythonSimplified
@PythonSimplified 2 жыл бұрын
Thank you so much Tomkins! 😁 That's exactly my goal with each tutorial, super happy it shows! Thank you for the lovely comment! 😃
@tehpimpmasta
@tehpimpmasta Жыл бұрын
Not to mention, make coding look sexy asf. 😅 😍🤤🥵🤩
@romanhaskelsky969
@romanhaskelsky969 Жыл бұрын
One small tutorial has done more than all the other lessons in the last 6 months! Thanks!!!
@powersprouter
@powersprouter Жыл бұрын
Thank you!!!! Your tutorials are a gold mine - you really are talented at making confusing subjects much easier to understand.
@mkhadka123
@mkhadka123 Жыл бұрын
The best thing about your videos/explanation is that you make complex topics in programming such as OOP so much fun to watch and understand them clearly at the same time. It feels like learning when we were children.
@internetchild
@internetchild Жыл бұрын
Wow! This is by far the best tutorial I've come across. Thank you :)
@murtazabadshah1535
@murtazabadshah1535 Жыл бұрын
WOW amazing tutorial. You explained the concepts so clearly. I finally understand the self notation and what it's used to for. Thank you so much! Please keep uploading more tutorials :)
@RicCarden
@RicCarden 2 жыл бұрын
Amazing. You took 12 minutes to clearly explain what I've spent 2 days trying to get my head around. I've got it! You have a real talent for teaching. :-)
@tiramercu
@tiramercu Жыл бұрын
This is so much more understandable than my university lessons. Thank you so much!
@calebsuit5390
@calebsuit5390 4 ай бұрын
Your videos are the most helpful python tutorials I have found. You are a great instructor. Please keep making more great instructional content.
@DucatiSydney
@DucatiSydney 2 жыл бұрын
You are the best teacher! Very polite in communication, attention to detail is impeccable (you don’t forget or fail to explain any details like () something like that). The way you take time and not rush things really helps a beginner to follow along, although English isn’t my native language, I could pick up all the jargons and technical terms and relate to it smoothly. Feels great to discover your channel. more videos please! .upper()
@SLTechnologyBest
@SLTechnologyBest Жыл бұрын
Dudeee till now i was struggled on OOP. It's mad how simply you explain these stuffs great work no words to explain woaaah. Continue the good work
@joereality1664
@joereality1664 Жыл бұрын
I've learned Python for work and have been using it regularly for work projects. I just gotta say, even watching these beginner videos again after some time is teaching me new things. She's dropping little nuggets here and there that explains so much that I didn't fully understand until getting more familiar with OOP. Absolutely gold. And she's great at breaking it down and explaining!
@americovaldazo6373
@americovaldazo6373 Жыл бұрын
As a guitar player, this is the best example to learn classes and inheritance in Python. Thank you very much.
@Novacasa88
@Novacasa88 2 жыл бұрын
You have an exellent teaching style and presence. Good work. Enjoying your videos.
@amodiy
@amodiy 4 ай бұрын
Thank you thank you thank you! For explaining these concepts in the most simplified manner ever, gained a subscriber
@tastonic30
@tastonic30 2 жыл бұрын
The best python KZbinr I would personally recommend... The simpler it is explained.. The simpler it is even to grasp and execute... Keep it up
@vctorroferz
@vctorroferz Жыл бұрын
Just amazing ! such a complex topic in what a wonderful and easier way explained !
@Aziz_Ahmad
@Aziz_Ahmad 3 ай бұрын
Thank you for the amazing tutorial playlist! I learned so much and really enjoyed the clear explanations and practical examples. Grateful for the knowledge you shared! video no #2
@eduarmafla6148
@eduarmafla6148 Жыл бұрын
I have beeb quite awhile learning python. YOU are the best tutorial person that I have experienced teaching python and more. and you are the smart, everybody should learn from you.
@Khigha87
@Khigha87 Жыл бұрын
Thank you so much for this video. I was struggling with OOP and reading words from a few books provided only marginal clarity. Your singing surprised me, I don't know why I didn't expect you to sing well lol. Your singing ability is second only to your ability to explain coding concepts. Thanks again!
@stefaniafiorucci9826
@stefaniafiorucci9826 Ай бұрын
I love the way you teach! So simple 🎉
@deniskasala8520
@deniskasala8520 Жыл бұрын
Thank you for making OOP easy to understand, much appreciated. From south africa.
@troylindstedt1458
@troylindstedt1458 7 ай бұрын
You explain things so we’ll. Thank you!
@charisagapi1648
@charisagapi1648 Жыл бұрын
Thanks Mariya for your perfect and pleasant style of present python....i enjoy and have addiction to your lesson !
@novicetech1
@novicetech1 6 ай бұрын
Another amazingly useful video. Thank you.
@user-ec4hz2ft6h
@user-ec4hz2ft6h 5 ай бұрын
This was perfect for beginners like me, I combined this with the free practice exam and study guides i found on Learnology World, although those materials were useful for me to prepare for the type of exam questions that i should be expecting in the exam, these video was good in helping me understand the course better, all essential topics was mentioned. thank you very much ❤ i really appreciate
@obajiokereke4028
@obajiokereke4028 7 ай бұрын
so much covered in this video... kudos..highly recommended
@noelremasu
@noelremasu 2 ай бұрын
You are such a great tutor, I wish I had you as my mentor or lecturer at university
@aguypassingby1945
@aguypassingby1945 10 ай бұрын
Thank you, Mariya!!! You're awesome!
@DominikZalewski85
@DominikZalewski85 Жыл бұрын
Best explanation I saw on YT! You are such a positive and funny person and great at teaching. I'm surprised you have 100k subs "only" ;)
@freedtmg16
@freedtmg16 2 жыл бұрын
Wow this really helped me understand classes as a whole a lot better across all languages. The examples you used were so much better than (pet eat or family cat or whatever I usually see) thanks!
@PythonSimplified
@PythonSimplified 2 жыл бұрын
hahahaha yeeey!! I'm super happy you found my tutorial helpful! 😀 I'm gonna film an additional practice tutorial soon, this time using vehicle classes and inheritance. We will draw different types of vehicles in a recent Pygame project, so this time we'll see an extra visual example (which I believe is the best way to learn 😉)
@anthonyrojas9989
@anthonyrojas9989 2 жыл бұрын
Your videos are fun and informative! Thank you
@fbravoc9748
@fbravoc9748 6 ай бұрын
Amazing tutorial !! Thanks!
@artaniskim2120
@artaniskim2120 Жыл бұрын
As just as what Albert Einstein said "If you can't explain it simply, you don't understand it well enough." I was struggling with the OOP and you simply nailed it for me. Thank you so much. looking forward to see more videos from you !.
@anthonypretty2877
@anthonypretty2877 11 ай бұрын
I'm quite astonished you don't have many more subs as I have viewed hundreds of related videos and yours are , by far, superior in both the presentation and content explanations. Class first!
@Dragons927
@Dragons927 4 ай бұрын
A gorgeous example of a class guitar!
@validol696
@validol696 Жыл бұрын
Thank you so much from Ukraine! 🌹 You explain everything very clearly!!! Subscribed
@breamgarces4680
@breamgarces4680 Жыл бұрын
there is a print function in the class and yet explicitly called outside the class. I think it is best to write return("pam pam pam pam...") then call it outside the class as print(my_guitar.play()). I am still learning python and I am catching a "none" error. I am not sure about my solution though but it works in my end. Thank you and keep providing quality tutorials! Love from the Philippines!!!
@Manopatz
@Manopatz Жыл бұрын
best tutorial for using multiple class !!!!
@AbhiKumar-oc6qw
@AbhiKumar-oc6qw 6 ай бұрын
Very good explanation of this topic. Thankyou so much for this and this explanation is very helpful for me.
@johnlj_ciscocertified
@johnlj_ciscocertified 4 ай бұрын
well explained, thank you for this video it will help me on my Cisco DevNet learning and certification.
@sgarrison05
@sgarrison05 4 ай бұрын
I have read and watched other explainations on this topic. By far, this was the best explaination with easy examples. I have the basic and always felt like the intermediate topics are not covered quite as well or often. Thank you for your dedication.
@PythonSimplified
@PythonSimplified 4 ай бұрын
Thank you so much for the lovely comment!! 😃😃😃
@bigbadcatbigbcy2933
@bigbadcatbigbcy2933 9 ай бұрын
Thanks a lot. This helped me a lot
@czglory
@czglory Жыл бұрын
You are a skilled teacher thanks
@NoobYoutuber83
@NoobYoutuber83 2 ай бұрын
Beautiful teacher with nice explanation
@kostas6915
@kostas6915 10 ай бұрын
Top explanations and clarifications!
@renibrito8411
@renibrito8411 Жыл бұрын
Great i´m from brazil and i study in my native language and and practice my english i watching your videos to practice more. congratulations for you teaching me i'm learning a lot and , learning english as well .
@kvelez
@kvelez 9 ай бұрын
Excellent video, really liked this tutorial.
@SusanAmberBruce
@SusanAmberBruce Жыл бұрын
I would love to see a tutorial about using Class's in building a Tkinter app, especially assigning variables to input methods like textbox. Thanks for all your great video's, you certainly know your stuff 👍
@mathieuseligmann9488
@mathieuseligmann9488 Жыл бұрын
Thank you very much, great content
@jmdamasceno
@jmdamasceno Жыл бұрын
you´re so amazing... So many helpful to watch your lessons... It is so nice to see you, so beautiful! thanks a lot.
@ellukayou
@ellukayou Жыл бұрын
You are good transmitting knowledge
@qiyuanzhang1641
@qiyuanzhang1641 Жыл бұрын
Thanks, You are really good teacher of Python! Your video lessons are beautifully crafted, and I would love to see your videos in China.
@nikolayhodyunya6861
@nikolayhodyunya6861 Жыл бұрын
I'm a professional (senior) programmer with 5 years of experience of writing production quality code, still i find this tutorial refreshing.
@shahradkamran6922
@shahradkamran6922 Жыл бұрын
this tutorial was very useful for me and i'll say much thanks to the developer
@zahedulislamchowdhury2279
@zahedulislamchowdhury2279 2 жыл бұрын
Excellent Lecture for Python Learners. I am waiting your next video about of Object Oriented Programming & Data Structure Algorithm in Python. Please make video about this topic.
@ewemakugbebright7986
@ewemakugbebright7986 Жыл бұрын
I just love you... Thanks alot ❤️❤️❤️
@peaceoluchi2377
@peaceoluchi2377 6 ай бұрын
Thanks for your classes. You broke down a hard nut to crack for me.
@suvimpemel5583
@suvimpemel5583 2 жыл бұрын
This was a great tutorial for me. It so happened to be that I new these things and I never new where to use and why to use. The best part is I'm a bass guitarist, the examples you took are really striking to me. Also the song "House of the rising sun" is a song that my brother and I use to play instrumental on.
@PythonSimplified
@PythonSimplified 2 жыл бұрын
Thank you so much for the incredible comment Suvim! I'm so happy you found this video helpful! 😃😃😃 "House of the rising sun" is one of my favourite songs to play! it has super easy chords and everybody knows it by heart! I usually replace "New Orleans" with "Hastings Street" as I live in Metro Vancouver so it's quite appropriate! hahahaha (it's a really nasty street!) I think it's absolutely awesome you play bass! We can almost start a PythonSimplified band with Ryuya Sho on the drums and you on the bass! We only need lead guitar and we're good to go (I have a feeling that your brother might be able help with that)! 😊 I don't think many people know this - but I've been singing in a heavy metal band when I was younger so the music vibes are strong with me! 😉 Now I only have my classic guitar, my voice and my audience which consists of my spouse and my cat hahahaha (unfortunately all my bandmates are on the other side of the planet and it's not as fun to write music on your own - I've always seen it as a team activity! 🙃)
@suvimpemel5583
@suvimpemel5583 2 жыл бұрын
@@PythonSimplified wow, I would love to play the bass if you are putting up the band together. Yes my brother plays the lead guitar. He is much better on production side. I'm pretty sure your audience is mesmerized by your talent and my prayers on your bandmates.
@srlhyo
@srlhyo 2 жыл бұрын
new or knew?
@suvimpemel5583
@suvimpemel5583 2 жыл бұрын
@@srlhyo "never knew", Thanks for the correction
@srlhyo
@srlhyo 2 жыл бұрын
@@suvimpemel5583 glad to have helped!
@Subconscious97
@Subconscious97 7 ай бұрын
Thank god there is this beautiful angel to learn from because I’m tired of indie voices
@haroldsu1696
@haroldsu1696 Жыл бұрын
inspiring ,and thank you !
@tanveerelahi
@tanveerelahi 2 жыл бұрын
like your funny way of teaching, i now got an idea about classed
@ornellatortorici
@ornellatortorici Жыл бұрын
Thanks a lot for this tutorial! It starts to become clear in my mind! :D I have to build a GUI with a Python program for work and I just found your kivy tutorial, which was great! I love your way of explaining things and your good energy is contagious :) I started to learn Python years ago but was still stuck on learning about object language and classes, and I was always avoiding it. Now I start to feel more confident about it :) Just a question about this tutorial: so there's no way to store confidential information? I was expecting you to show the good solution after showing that the private members is not a good one 😅
@varsketisLT
@varsketisLT 2 жыл бұрын
You are my favorite python teacher, thank you so much! Now working on my first kivy app, which I started half a year ago, then things in life happened and I just stopped working on it.. Picked it up a couple of days ago and voila! Already created my own settings screen with a json file to dump the settings into; already have 2 languages (en and lithuanian) built-in, and also I'm starting to really know what I'm doing. Hopefully my github page will have a single completed project soon :D This OOP tutorial just cemented everything I have thus far learned. Thank you so much!
@adebanjoabiodunadeyemi4259
@adebanjoabiodunadeyemi4259 2 жыл бұрын
I need adequate tutorial on kivy....any recommendations please?
@varsketisLT
@varsketisLT 2 жыл бұрын
@@adebanjoabiodunadeyemi4259 Depends on what you're building. Have you built anything already? Or do you want to start from scratch?
@adebanjoabiodunadeyemi4259
@adebanjoabiodunadeyemi4259 2 жыл бұрын
I want to start from scratch. I will appreciate your assistance
@wahswolf88
@wahswolf88 Жыл бұрын
So easily understandable teaching here. Subscribed.
@PythonSimplified
@PythonSimplified Жыл бұрын
Thank you so much! Welcome aboard! 😀😀😀
@munivoltarc
@munivoltarc 9 ай бұрын
She is rocking on subject and emotions
@dimitriosdesmos4699
@dimitriosdesmos4699 2 жыл бұрын
very clearly presented i actually enjoyed it.
@PythonSimplified
@PythonSimplified 2 жыл бұрын
Thank you so much Dimitrios! glad you liked it! 😀😀😀
@danny12345
@danny12345 Жыл бұрын
Thank you
@damianphillips8266
@damianphillips8266 Жыл бұрын
Very Informative! Why can't some lecturers be more like this ?? Instead of visiting the university of KZbin !! 👍👍👍
@elastvd7503
@elastvd7503 Жыл бұрын
Very cute explanation
@amourvido8027
@amourvido8027 2 жыл бұрын
I just feel like you are the best!❤️🔥🔥
@PythonSimplified
@PythonSimplified 2 жыл бұрын
Wow!! Thank you so much Amour!! 😃
@samrasoli
@samrasoli Жыл бұрын
useful, thanks
@ryansh86
@ryansh86 7 ай бұрын
Wow, I was struggling for few days to understand Classes in python. In the beginning, I simply didn't watch your videos more than 1 minute bcoz I thought a hot chick trying to get some extra views. But I saw your videos popping up multiple times and start watching complete videos. Damn, she is one of the best python tutors out there. All my doubts are clear now. Thanks 🙏 for such amazing videos.
@juanroccia
@juanroccia Жыл бұрын
literally in love
@inityo
@inityo 3 ай бұрын
You teach very good, I subbed..
@GregThatcher
@GregThatcher 3 күн бұрын
Thanks!
@marvinnunez3037
@marvinnunez3037 Жыл бұрын
Such a great tutorial!!!! As a basic python course student I have learned a lot of hits from this tutorial. Dealing with OOP, do you have any tutorial where uses a dictionary as an attributes in a class construction? I need to work on a project with a patient record with id, name, lastname, phone number, address and health conditions and drugs (last two as a list). It will be very appropiate because I can use the id as a key and the other information as another dictionary...
@sufianaliyyii9596
@sufianaliyyii9596 Ай бұрын
you are so cleaver in teaching . i request you to provide more detail tutorial on Django with your such brilliant mind please. i search for more videos on Django and python, but their content is not complete. thank you
@nandinirm2234
@nandinirm2234 Жыл бұрын
Good explanation ... Fan from India
@fokstephen3642
@fokstephen3642 Жыл бұрын
You are very pretty girl🥰 Love watching your tutorial. Very clear and easy to understand
@gareththwaite5128
@gareththwaite5128 2 жыл бұрын
Great video. Well done
@PythonSimplified
@PythonSimplified 2 жыл бұрын
Thank you so much Gareth! Glad you liked it! 😊
@fouezdesign
@fouezdesign 2 жыл бұрын
Great Great Great... Btw, congratulations Canada 🍁 for joining the others ⚽
@chrisojwang
@chrisojwang Жыл бұрын
Am here to watch and undestannd later😀
@parijatbandyopadhyay8057
@parijatbandyopadhyay8057 2 жыл бұрын
Awesome!
@PythonSimplified
@PythonSimplified 2 жыл бұрын
Thank you Parijat! 😁
@digigoliath
@digigoliath 2 жыл бұрын
I am enjoying tihis series Mariya. And hey, I am a Classical Guitarist! Great content & presentation as usual. Glad that I did Java OOP so I am in familiar territory. :))
@PythonSimplified
@PythonSimplified 2 жыл бұрын
That's awesome! thank you so much! 😊 Will do another practice tutorial with class inheritance soon - this time generating a parent vehicle class along with sedan, truck, motorcycle, van, coupe child classes. We will then randomly select a child class and draw it as the enemy vehicle in the recent car game we've created! 😀😀😀
@digigoliath
@digigoliath 2 жыл бұрын
@@PythonSimplified SWEET!! That would be so much fun. 🤩🤩
@manutpunpook9197
@manutpunpook9197 10 ай бұрын
love you again
@musiconearth-nocopyrightmu12
@musiconearth-nocopyrightmu12 Ай бұрын
thank you mam..
@BicospaceTech
@BicospaceTech Жыл бұрын
When you said ahhhha you remind me with Gargamel lol >>>> sorry it was very funny, but thank you, you so dope and very help full
@user-hh8dy8es3b
@user-hh8dy8es3b 7 ай бұрын
Hi! Love the channel. Do you know what version of Python you're working in? I'm in 3.6, do you know if there's any big differences between 3.6 and what you're working in?
@ReconCadre
@ReconCadre 10 ай бұрын
very nice mam!
@shuvo_247
@shuvo_247 9 ай бұрын
Beauty with the Brain.
@AlanHernandez-mw6xb
@AlanHernandez-mw6xb Жыл бұрын
Thank youu
@diwakar_tsn
@diwakar_tsn 2 жыл бұрын
Just ❤️ 🔥 🔥
@PythonSimplified
@PythonSimplified 2 жыл бұрын
Thank you so much Beluga! great chatting with you!! 😊
@mikekerry7989
@mikekerry7989 Жыл бұрын
Glad to hear you now calling them ATTributes, and not atTRIButes as you did earlier!
@PythonSimplified
@PythonSimplified Жыл бұрын
Hahaha yup! I was corrected in the comments of the previous video 😉
@ahmedutuber
@ahmedutuber 2 жыл бұрын
thanks
@lemartien25000
@lemartien25000 3 ай бұрын
Gracias
@goyalmukeshkumar
@goyalmukeshkumar Жыл бұрын
Good👍
@corneillembay8893
@corneillembay8893 2 жыл бұрын
BBBBIIIIIGGGGG THANKS 🙏
@PythonSimplified
@PythonSimplified 2 жыл бұрын
Absolutely! enjoy! 😃😃😃
@brianketelboeter8522
@brianketelboeter8522 Жыл бұрын
'chile' class LOL. awesome tutorial btw
@PythonSimplified
@PythonSimplified Жыл бұрын
Thank you so much Brian! 😀
List Comprehension - BEST Python feature !!! Fast and Efficient
14:51
Python Simplified
Рет қаралды 186 М.
Каха ограбил банк
01:00
К-Media
Рет қаралды 6 МЛН
PINK STEERING STEERING CAR
00:31
Levsob
Рет қаралды 21 МЛН
Кәріс өшін алды...| Synyptas 3 | 10 серия
24:51
kak budto
Рет қаралды 1,3 МЛН
Please be kind🙏
00:34
ISSEI / いっせい
Рет қаралды 82 МЛН
Python Object Oriented Programming (OOP) - For Beginners
53:06
Tech With Tim
Рет қаралды 3,3 МЛН
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 380 М.
super/MRO, Python's most misunderstood feature.
21:07
mCoding
Рет қаралды 212 М.
Functions vs Classes: When to Use Which and Why?
10:49
ArjanCodes
Рет қаралды 142 М.
Recursion Simply Explained with Code Examples - Python for Beginners
9:07
Python Simplified
Рет қаралды 156 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 377 М.
Learn Python Functions - Quick Python Project For Beginners
10:04
Python Simplified
Рет қаралды 89 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1 МЛН
Настоящий детектор , который нужен каждому!
0:16
Ender Пересказы
Рет қаралды 434 М.
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 6 МЛН
Gizli Apple Watch Özelliği😱
0:14
Safak Novruz
Рет қаралды 2,4 МЛН
ТОП-5 культовых телефонов‼️
1:00
Pedant.ru
Рет қаралды 18 М.