Python Object Oriented Programming (OOP) - For Beginners
HTML-код
- Опубликовано: 9 май 2024
- In this beginner object oriented programming tutorial I will be covering everything you need to know about classes, objects and OOP in python. This tutorial is designed for beginner python programmers and will give you a strong foundation in object oriented principles.
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
tech-with-tim.teachable.com/p...
📸 Instagram: / tech_with_tim
🌎 Website techwithtim.net
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-ruscica-82631b179
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
💵 One-Time Donations: www.paypal.com/donate/?token=...
💰 Patreon: / techwithtim
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
⭐ Tags ⭐
- Tech With Tim
- Python Tutorials
- Object Oriented Programming Python
- Python OOP
- Python Objects and Classes
- Classes Python
- Objects and Classes Python
⭐ Hashtags ⭐
#python #OOP
Start a high paying tech career making $60k+/year with NO DEBT: coursecareers.com/a/techwithtim?course=software-dev-fundamentals
Tech With Tim “JUTS noticed” you say? Hahahah
Shhhhh
Hello tech with Tim I'm a 14 year old trying to learn python. I'm finding it hard to get out of the beginner phase. I tried code wars but found the problems too hard. Any advice on how to practice and improve and what resources I can use. I have pycharm ide set up and have lots of free time with this quarantine going on.
@@bobturner2764 Try to learn from a book. It's easy to learn from a book because they're well organized and structured.
How are you doing during these times
Are we all going to ignore that fact that the acronym for Python Object Oriented Programming is POOP?
yes
nope
😆
That is exactly what we are going to do
LOL
Tears from my eyes when I finally understood what "self" keyword here is all about. Thank You!!
I look at it like "this" keyword in c++
I’m struggling to understand self 😢😢
Update: after watching the video. I now understand what you mean… i understand it now! 😮😮😮
@@lozaur9837🎉👏👏👏
Explanation on self: self refers to the class. Say you are defining a function and you use the parameter self. That parameter means that you will use that class you’re defining the function in. You will have access to all its attributes by just typing in self.attribute
0:00 OOP basic
28:11 inheritance
40:53 static and class methods and attributes
Don't mind me, just putting this here since I might need it.
time stamps on these type of educational videos are definitely helpful. Thanks! Hopefully Tim have some time to go through some of these older videos and add chapters.
Can an attribute be an 0bject
@@smaransure2234 i think not
Thank you
@@Psychetwo yh
You really are a star. I got a concussion and had to miss several weeks of my intro to computer programming summer course, and your videos literally saved my grade. I'm trying to get into med school, and people like you who put in hours of effort just to help complete strangers are an absolute blessing. Thank you so much Tim. I'll make sure to donate to your patreon once I can afford to!
Hope you are getting better now!!!
@@baka_geddy WOOT WOOT! I also have to add KatieSkate, you are a STAR! Seriously? Med school? And learning OOP/Python? Wow, just wow, humbled. KEEP IT UP YOU MAD ONE YOU!!!!!! Get well and GO AFTER IT!!!
@@TheJacklwilliams many of my bio stream friends can code python... It's not that difficult though...
Yeah like I also want to donate to my guy Tim or bprp or any educational vids but to young to donate or have money
@@executorarktanis2323 Tim is brilliant! You can donate to him indirectly by sharing his videos due to RUclips Monetization, so you don't need to have your own money to give him some.
As someone who's visually-impaired, I REALLY appreciate you using larger fonts in brightly-contrasted colors to do your tutorial. It REALLY helps!
Seriously, you gave me a better understanding of OOP in the first 8 minutes than in hours of videos and reading elsewhere.
Never finished a 54 minute educational video without any break. So well organised and clearly explained. Not a single minute wasted or rushed. Thank you Tim. Channel subscribed!
on god.
Honestly
literally agreed!
fr bruh
Same here, amazing tutorial!
"I hope this make sense"
man, it was clearer than water. Thank you so much.
The quality of these FREE tutorials are amazing. thank you Tim.
I’ve been playing with Python for years but never really got my head round OPP, some of it yes but not enough to actually use it. Your video is amazing and makes a lot of sense. I can’t wait to start practicing. Thank you so much!
It's such a blessing to have such a spiffy guy putting this out for free.
class Emotion:
def __init__(self, g, l) :
self.g = g
self.l = l
def get_g(self) :
return self.g
def get_l(self) :
return self.l
e = Emotion("gratitude", "love")
print ("I feel", e.get_g(), "and", e.get_l(), "for your content")
You've just explained OOP in 15 minutes better than my course teachers did in a semester. Thank you!
american lol
@@Sol4rOnYt foreigner lol
@@jx6040 what you said made no sense lol
neither did the previous comment@@kesatola3554
Tim I would like to thank you as I have made my first project using java, and its thanks to your tutorials that have helped me through learning python
Your introduction is so well done! I only did a 6 week basic course about Python and OOP wasn't included. You're doing such a good job explaining it.. I think this is the fastest I have ever subscribed to a chanel. Keep it up Tim!
I was stuck on this subject in another platform because I couldn't comprehend what was being taught, then I came across your channel. Honestly I couldn't be happier. This is one of the best tutorials on RUclips when it comes to OOP. Thanks for clearing things up.
Thank you so much Tim! I have had so much confusion about OOP for years and today after watching your tutorial I can say confidently that I understand OOP much better. Thank you
Wait seriously this was just uploaded woo. Haha. So happy I found this channel
Edit: this was the “easiest” 53 min of coding to digest on a video. Tone, example, audio quality, clarity. First step slow and explained. Then doing it again a little faster. Loved this video. More intermediate Python vids please ! 🙏🏼
You answered a number of complex topics in only one hour - this was an outstanding use of time!! THANK YOU!
I cannot describe how glad I finally am to get to understand the basics of Object Oriented Programming in one afternoon! Thank you!
I just wanted to say that you have a great way of explaining the topics without talking down to the listener.
Thank you for this lesson. I haven't really used any OOP (knowingly) in Python before, but I have done a few courses in C# and Java, and I can really say your explanation of objects has been brilliant.
I've tried to understand classes many times. This is the only one that got me there. Self, methods, inheritance, init ect. I get it now. Thanks!!
His interpretation is incorrect. You may want to read some good books.
@@aammssaamm can you elaborate? Which part is incorrect?
@@JayMaverick Already.
@@JayMaverickDon't bother with his speech. He is only a poor RUclipsr with 91 audiences, compared with Tim, 466K subscribers.
An average guy knows who to choose to believe. :)
@@aammssaamm tell a good book for python OOP
HANDS DOWN! the best explanation of classes I've ever seen. Great work, thank you!
Thanks for such an in depth but understandable tutorial! I learned OOP a year ago, but I have completely lost my skills after not coding for a while. Super great refresher video!!!
Absolutely brilliant lesson for high content to background noise ratio. This video has made for a really educational and enjoyable code-along morning. Thank you!
I'm in the final year of my CS degree and this is by far the BEST OOP explanation I have seen. GREAT WORK!
I love the way you verbosely explains the inner workings of code even in its low level, it makes me understand more.
You really do a great job breaking things down into more digestible information. Thanks for your hard work!
at 39:00 the reason we do super().__init__(*args) is to extend the Pet.__init__() method and add more attributes without completely overwriting the Pet.__init__() that gives us access to the self.name and self.age attributes that are used in the other methods like show. So the way I think of inheritance is there are four ways of doing this: 1) straight stealing from the parent class , 2) completely overwriting the parent class methods, 4) partially overwriting the method (extending the parent method (using super)), 4) independent new method.
When I started learning OOP it took me a while to differentiate between methods types, so if you are struggling with that too, here's a quick summary:
Method = function related to that instance of a class. Use this type it when you are using values of the own instance (its own name, age, etc). You need to create one instance to use it.
Classmethod = function related to that class and that class only. Use this type when you are using values of the class, not the instance (For example, using a class that retrieves the total count of instances of that Class created and stored in a class variable). You don't need to create one instance to use it.
Staticmethod = function not related to that class. Used for organization purposes (For example, a Calculator class with add, subtract, multiplicate, etc methods). You don't need to create one instance to use it.
No reply, why? Thanks for this, it really helped me :)
This really helped, thanks!
Finally what I was looking for
Thanks for the awesome explanation. Keep up the good stuff 🤗
I thought staticmethod and classmethod are the same thing, the function related to a class not to instances of that class.
Thank you Tim! I'm an old school programmer- System 370 Assembler, COBOL, myriads of scripting languages..loads of top-down stuff. .I took a week-long JAVA course a while ago put on by none other than Sun Microsystem and they proceeded to confuse me so much that I STILL didn't "get" OOP. But in 53 minutes, you've made me understand! Thanks! Thanks! Thanks!
He is so good at explaining the basic stuff that other instructors neglect
I've been studying python for some time now with Zed Shaw's book 'learn python 3 the hard way'. The whole process has been smooth till I got to oop, my confusion started. But now, watching your video, things are clearer.
Thank you for the effort you put into this, very informative.
I'm over a year late, but this is the best explanation of classes I've ever seen. Great work, thank you!
I was about to mention this as well. Really excellent examples and well delivered information!
Who cares if you're a little bit late! Learning is eternal
This is super helpful! I'm starting to learn python and I was getting stuck exactly on what you mentioned, having multiple lists to store values and having to search through them. This is a very nice solution to my project!
Thanks a lot for this video. I learned what I was trying to learn from reading many obscure books.
I like the way you focused on beginners and didn't dive too deep when explaining each concept, before going into details a beginner doesn't need for the moment.
Thanks, man. This really helped me with just getting my basic understanding, I've taken notes, and watched the video about 3-4 times now just to see whether or not there was more that I could get from it. Thank you very much for taking the time out of your life to help people like me grasp the fundamentals of programming. Because this has also helped me with other languages, not just Python. And I had to come back to your video just to leave this comment thanking you. Thanks again bro.
That's really nice of you bro.
You hope?😂😂😂 You're sure we understand that.. you're awesome brown.
Dude - I love your videos. Thank you so much for doing this. Your ability to explain concepts is the best on RUclips. Thank you!
Just logged in to say thank you for your excellent video. I've done OOP before but I hadn't coded in years and decided to do an AI course and realized how much I needed a solid understanding of classes. As mentioned many times, this video is of the highest caliber. Thank you for your time and effort.
I have struggled to "get" OOP in the past, and this video was fantastically helpful. Thanks!
I never understood this subject, this and pointers were the biggest hurdles for me, hopefully after I watch this I will understand it completely. Thank you tim
that's probably the best object orientation programming overview on youtube so far
What I like about Tim's explanation is that he doesn't start his explanation with terms that are difficult to understand, thanks a lot Tim, god bless you
Dude, literally saved my life . This is the best OOP video Ive watched and its broken down so, so well. Im so glad you made this Tim , literally godsend. Thanks so much. I now understand OOP and enjoy it due to you :D Thanks again for making it so easy to follow with the examples!
This is absolutely the most comprehensive look at OOP that I've ever had. Thank you for being so thorough with your explanations. I had multiple "oh so that's what that means" moments.😁
That's the sign of a good explanation.
Hey, its a year later, and I am having this same experience watching his video. This is a fantastic introduction to OOP.
Amazing, really clear and so thorough. It was almost difficult which is why I was excited to keep watching and rewinding and yet so simple 👍🏽
Always had a hard time with classes, etc. This is an amazing tutorial, thank you so much!
Recently started self learning python for fun. You've been my go to for everything video related. Well explained everytime.
"if you can't explain it simply, you don't understand it well enough" - Einstein, your video really make complicated things easier to understand, i have paid about $300 on a programming course that explained OOP poorly, watching your video really helps me a lot
Tim, last few weeks I’ve been going through the basics, and this tutorial has really gotten me excited for what can be done and made. Appreciate the time and effort you made into making this video. You got my Subscribe for sure
You have literally found the way to put the logic behind all this class thing into my brain. Thanks to internet i have access to such teachers otherwise i would not even dream to have. Please keep up the work. Thanks
Awesome video! No extra BS, clean concise explanations with clear easy examples. Thank you!
Really fantastic, you have a gift of explaining things very well, especially for someone so young. Thank you for your efforts in producing these videos!
I started learning python at first from your channel and I was able to learn a lot. I feel the need to learn more about OOP in python so I watched this video, The video was really helpful and I like how it does not contain any advertisement and focus solely on teaching. I wish I could provide lectures like you in the future. Thanks so much for your videos!
Thank you Tim for making this video, it really helps jog my memory of what I've learned in the past about Python. Keep making these videos, these are awesome.
Super easy to understand, all the other youtube videos were hard to understand but your's was perfect. Thank you so much
Just Wow, and Thank you, Tim! I am learning python for 3 years and all of the time I had issues with the OOP concept in Python as my degree is not IT ( I am a biotechnologist, PhD), but with this amazing video, I learned all I needed and looked for through passed years! Thanks a lot, I follow all of your job and advice all to use your channel! your teaching style is wonderful!
I have been learning py for a year and am quite comfortable with it now, but I still don't know OOP very well :,)
It is 2023 I started and finished this today. Thank you TIm for helping me along my python journey.
I think your tutorials are so useful because you show us real life examples. Based on this tut I will be able to code something like booking system! Thank you for your job and stay close to real life examples. You are one of the best.
you are litterally the best teacher in programming
This channel must be named as "PAID CODING SCHOOL DESTROYER".
@D Cam He's teaching us A LOT ( + with great explanation )
Not so soon. Lack of experience in real projects can hardly compete with experienced teachers and proper professional culture.
@@aammssaamm Can we just be grateful that we can get thorough programming lessons for FREE? Sure, Tim isn't perfect but his tutorials are very useful and in some cases, actually does better than your so called "experienced teachers"
@@stormtorch
So TRUE. I learned many things from this video. I love this.
@@stormtorch He teaches wrong things which will cost you a lot in a long run.
i'm taking a course and we're on this subject but your video made it so much more clearer for me! Thanks!
Best OOP video for beginners. I have worked with python before but not until I watched this video have I understood OOP so thank you.
He's very good at explaining everything he's saying.
This is a really good video. I'm a chemical engineer, and I've been using python for simple scripting and numerical methods (e.g. 1D+time FEM) for a few years. This video taught me everything I need to know to simulate a helium brayton cycle. Each stream is an object under the class 'State' and each piece of equipment is an object under the classes 'Heat' and 'Work', each of which inherit its inlet/outlet streams from the parent class 'Equipment'.
I'm sure as I watch your more advanced series on the topic I will realize how clunky my first attempt is and will be able to improve it.
I am a chemical engineer. Would like to write code for dynamic simulation of equipments. Thinking on the same lines. Can we get in touch, share ideas??|
With you I understand something that I've been studying for so long, thank you so much!
I spent 3 days reading and trying to understand OOP , you just clarify everything , thanks
Tim is the kinda guy who uses his name as an example for a dog's name❤️
And give himself a 95 grade as well.
I love how the cat "Bill" is 34 years old. Never have seen such an old cat
The oldest cat known actually lived for 38 years.
I mean cats can get pretty old, but there was a dog that was like 34 I think lmao
... Is that in cat years?
Is that a thing?!
🤣🤣🤣🤣
Ever heard of cat years?
This is the best explanation of 00P in Python that I’ve ever seen. Fantastic piece of work. Thank you so much.
Brilliant! U explained static and class methods in a way no other utuber could ever. After watching tons of utube videos on class and static methods I finally understood them
Mate this was fantastic. I am quite an experienced programmer in my own area, as an actuary, I have a good amount of experience with R and python, never much use for classes in my line of work and I have always found the concept a bit confusing, both the how and why. This took me about 10 minutes to see the value add in OOP and understand it. I've had other people explain it to me for hours and still struggled to understand the benefit. Well done!
Same. OOP always seemed like a way to complicate code. Tim does a great job explaining how it simplifies code and why to use it
Your teaching clicked so well with me. I never thought I'd enjoy learning OOPS so much. Are there going to be more videos on OOPS?
I cant emphasize how helpful this has been, you are a great teacher
The best tutorial I've seen yet. Thanks men. You made it look really easy!! Your examples really did help
It's probably the best Python OOP course on RUclips. Thank you so much, Dear Tim.
And a wrong one.
Says naming convention for classes is camelCase, when he should say PascalCase. Jokes aside, great content Tim, thanks a ton, just sharing this so we all could be smarter. Stay safe, much love
thanks for the video, i was watching another video about Object Oriented Programming and it got me lost and confused, and yours gave me a clear idea in under 3 mins
THANK YOU! THANK YOU! THANK YOU! Very well explained and this was just what I needed to truly understand classes within python.
Ayee perfect timing ^^ I'm having hard time with OOP but I'm pretty sure I'll be able to understand quite a lot from you. Thanks a lot for posting this
Same here lol , THANK YOU TIM
Me too man.
I studied computer engineering more than 10 years ago, never learned python or objective oriented programming and haven't done any serious coding in a decade. Your video was absolutely perfect for me to get back into the game. The pacing was just right for me to absorb the information at a casual pace and not get bored.
PS: Also like how clean Python is compared to C.
Hey Tim, I love your videos and I just wanted to say thank you. I learned so much from your videos in the last couple of days and I will keep watching more. Thank you!
BRILLIANT & MAGNIFICENT. Thanks for making the world a better place by raising other developers and sharing the fire and leting the engineering skills spread across the globe. Keep it up Tim
For those with Machine Learning backend a good example can be how you do:
model = Sequential()
model.add(....)
I learned a lot from you, thanks! Can you upload more of the "Advanced Python" videos ? They're great and we'd love more!
Maybe!!
@@TechWithTim Wha projects are you developing?
Have you checked out his new video on making a space invaders game. It may not be exactly what you had in mind, but making games is a great thing to have in your portfolio
Yes I love this video so much!
@@TechWithTim You're a really good teacher :)
This is an exceptional video for a topic I previously found really difficult to wrap my head around. I've subscribed!
This is very beginner friendly, lovely. I wish our professors had lessons like this. They kinda throwed us in the deep end with C++ and vague explanations, "this and that and you know how it goes" way lol. At least everything else felt easier after that. Thank you for this!
Excellent tutorial, Tim - thank you!
Do you have any recommendations on what we can work on to improve our understanding of OOP?
This is the best video I have seen on OOPS. You literally made me happy today!! Thanks for all the hard work.
I watched this video for two days while practicing along. Thanks Tim!!
Finally an actually great video with in-depth and simple explanation, that's what I call quality content. The video made it much easier for me to understand the basics of OOP, also I'm not afraid of it anymore. Thank you again
It teaches you wrong stuff
Programming since 1978. Now 72 years old. This is the first time that object-orientated programming has made sense. Many thanks
Wow
I wish I could help you out somehow, but right now I can't afford it to. I can't explain how helpful this has been. You are an amazing teacher.
thanks tim. this video randomly popped in my suggestion and opened gate to advanced python for me.
0:44 into the video and i must say "Thank you" for the font size.. Well done mate.
'here is an old dog, here is a young one'
bro if Tim reached 34 years old he's gona be breaking some doggo world records...
maybe it's dog years
You explained it pretty good, it made more sense than some other videos ive watched explaining it.
I rarely comment on RUclips.
This video made me leave an appreciation comment for Tim. You are a great teacher. You explained everything like a primary teacher explaining alphabets. I have an udemy course on OOP. But, when I find this video, I haven't opened Udemy. Thankyou so much for awesome tutorials. I appreciate your efforts.
Can I just say that in 7 min you cleared up what a whole highschool semester of programming never taught me. I mean I never thought I could learn programming.
Looks like you and me belong to same school, whole class understood programming except me, only in 10 minutes i understood a very high level concept called class.