In my 3 years of trying to learn object-oriented Python, not a single teacher adequately explained what the "self" keyword was for -- until now. Thank you again Mr. Schafer!
To everyone who is learning through Corey's channel. Do not ever doubt yourself whether you will land a job or not. You will, because I did by watching his videos. Thanks Corey. You are the best teacher.
✏ Notes attributes = data, methods = functions Instance of a class class variable , instance variable 🔖 Bookmarks 00:00 Introduction 00:33 Why use classes 01:09 A simple class 02:13 Class vs Instance 04:43 Initializing instance attributes with `__init__` 09:00 Custom instance methods 11:35 Common Mistake - Importance of passing `self` 14:25 Summary
This tutorial about classes cannot be better. I really mean it, its just perfect. In my life i may have commented 3 videos here on youtube altogether, but this time i really needed to say THANK YOU, because you saved me lot of time, effort, and nerves. I am just looking forward to your other videos. Amazing work!
This series of lessons is honestly some of the best training I've ever seen. It's so clear and concise. The examples are perfect too. I'm writing this 4 years after they were released and they still hold up perfectly.
🎯 Key points for quick navigation: 00:00 *🏗️ Creación y uso de clases en Python* - Las clases en Python permiten agrupar lógicamente datos y funciones para facilitar su reutilización y ampliación. - Los atributos y métodos de una clase representan los datos y funciones asociados a la misma. - En este video, aprenderemos los conceptos básicos de creación e instanciación de clases. 01:20 *📋 Creación de una clase simple: `Employee`* - Ejemplo de una clase `Employee` que representa a los empleados de una empresa. - Cada instancia de la clase `Employee` representa a un empleado específico con atributos únicos. - Se puede utilizar una clase como plantilla para crear múltiples instancias con datos personalizados. 05:20 *🚀 Método especial `__init__` (constructor)* - El método `__init__` se utiliza para inicializar las instancias de una clase con valores específicos. - Permite definir cómo se deben configurar automáticamente los atributos de una instancia al ser creada. - Los argumentos del método `__init__` corresponden a los valores que se desean asignar a los atributos de la instancia. 09:09 *🔄 Creación de métodos en una clase* - Los métodos en una clase permiten definir acciones que pueden realizar las instancias de la clase. - Proporcionan una forma organizada de agrupar funcionalidades relacionadas con la clase. - Los métodos pueden acceder a los atributos de la instancia utilizando la referencia `self`. Made with HARPA AI
Government funded bull shit. I can learn complex mathematics, science and physics online for free better then a $100,000 university degree could teach me.
00:00 Introduction 00:33 Why use classes 01:09 A simple class 02:13 Class vs Instance 04:43 Initializing instance attributes with `__init__` 09:00 Custom instance methods 11:35 Importance of passing `self`
I don't know you but before recording this video, it is crystal clear that you asked yourself how can I be explaining better the concept of class/object to novice learners and you just nailed it. Huge thanks for great work man. We all humans should consider of adding perfectness to our professions. Cheers from Istanbul!
2022 and still one of the most intuitive and relevant videos on OOP in UA-cam. Thanks Corey for this playlist, looking forward to complete the whole series within this week
Mate, I have hit gold. You legit explained OOP to me like it was so fucking simple. OOP is easyly one of the hardest concepts in computer programming but you explained it in a way i think anyone can understand. Thank you so much!
I have just started OOPs and every other videos I have watched , they were like “you have to use self, it is just the way”. Only u explained why it is there and for curious beginner that is very important.❤
It's there because the python inventors are weird like that. It could simply be a keyword like in Java. Then it would be: def set_first(first): self.first = first
This defiantly got my sub. People always seem to jump around, or leave things out, or mix terms when describing classes. This has been the most straightforward explanation I've come across.
This is the most clear explanation and demonstration on UA-cam, I paid 120$ for a python class and it’s not as clear as this. Good job man keep up the good work!
Any time I'm looking for a video explaining any coding stuff, it's always a bonus to find that Mr Schafer has the topic covered. Always good stuff from this guy. Clear diction, crystal clear explanations, pin sharp video, no silly background music, no lame attempts at humour or sounding cool, no dogs barking in the background, etc etc, just solid 100% no BS explanations and knowledge. Many Thanks.
Corey, thank you 1000 times! Very good explanation of object-oriented concept. Understanding self was a challenge and you were able to help it to sink in. Forever grateful!
I'd say that these details (how classes work, what instances are, what 'self' does and what happens in the background) are what distinguish basic and intermediate knowledge. And if you at least read some about it, you may detect similarities between different programming languages, and realize that it's often 'the same', but with a slightly different syntax. At least that's how i understand it. Thanks Corey, thank you for not being lazy (like me) and actually script, record, edit a video to help others understanding a topic which is very important.
i am completely beginner to coding.after started watching you're videos find coding is awesome.i have suggested these videos my other 3 colleagues to learn python basics.Gained lot confidence.Thank you.Thank you from India.
Have been searching all over the internet for a week to understand what classes are for and what is self here, this example was the best way to explain classes in python so far from videos and materials I have seen. Thank you.
I teach CS and Cory's channel is always my recommendation when a students needs supplemental material. Cory is my go to guy when I can't quite get through a particular student. Thank you Mr. Schafer for saving my butt more than a few times. Ironic note. I actually have a dog named Brooklyn lol
Out of the many years I've watched videos about anything on UA-cam, I can count on my hands the number of times I've actually commented on a video. However, the way Corey explained Python OOP through this video, especially a week before my computer science exam, I just had to drop a comment. This is one of the best and most informative instructional videos I've ever seen, like ever even outside of computer science. Well done!
loving it. I just started learning python and its my first programming language. I love how this guy explains new words like classes and instances in such a clear way!! thank you
Simple, concise and an amazing piece of work! Not only did I understand something I've been struggling to wrap my head around for a while, but I can now explain everything to my classmates too. Thanks a lot for making me look like some sort of Python Jedi.
I've been learning Python as my first language for a few months now, but I got stuck and couldnt' grasp the concept of OOP via Python. I started leaning OOP through books in Ruby, and I felt like the way it is presented in Ruby is SO much easier to comprehend compared to Python. I guess there's a reason why OOP is usually introduced within the first three chapters of any Ruby textbook (forgiving syntax/true object oriented language) vice Python which teaches OOP in much much later chapters. At any rate, once I understood the basics of OOP in Ruby (took like 2-3days).. the transition to Python OOP was pretty easy.. It's essentialy all the same besides some terminology differences. Great video and thanks :-)
THANK YOU! I just went through the OOP portion of a paid tutorial but still didn't feel comfortable with the content. So I search and found you. Great thoughtful and thorough explanation.
It's the plain English explanation of the difference between statements such as A. Emp_1.fullname() B. Employee.fullname(Emp_1) that make the difference and sets your tutorials apart from the rest. Better than Netflix. I binge watch Corey tutorials
Self isn't a keyword. You could write anything else there. That was actually a controversial topic, some python programmers being of the opinion that self should be a keyword in the language.
Great clarity - showing the "long version" of emp_1.first = "Corey" and then how it translates into __init__ was really helpful, never occurred to me that was what was happening. Have heard many explanations of init but this is the first one that was clear and made sense to me, thank you Corey!
If only our universities were filled with professors like you. God damn it! I feel as if I've wasted an entire year trying to learn something which you explained so easily and comfortably in 15 mins!! Thank You for the wonderful explanation.
I remember trying to learn python ages ago and not being able to understand what the hell self was or why it was used. This video made it so god damn clear that I actually can't believe it was so simple.
I don't usually comment on UA-cam, but I just can't help to tell you how amazing your videos are. You are making programming exciting again for me! I am so glad to have found you! Thank you so much for making these videos!
I love how you go through examples of "manually" setting up classes and proceed to use the constructor with the INIT method. out of all the python videos this one explains it amazing. I also appreciate the way you explained class and instances and the differences.
Wow, you did a fantastic job explaining this concept! I am learning to code for the first time and was not able to fully grasp this material until I saw your video. Thank you so much. I look forward to watching more of your tutorials.
Without a doubt, the best explanation I have heard on class creation/usage in Python (or other OO languages), and how/why 'self' is used. Most of the other videos/lessons I've gone through simply state something like, "Do it this way...because that's how it's done". Your 15 minute explanation surpasses everything else I've seen on learning Python / OO programming. Liked & Subscribed!
He doesn't explain why it's done that way though. It's kind of controversial as well, so you'd have to address different people's opinions to understand WHY there is this convention with "self".
honestly, i've been searching for a whole week websites and books to understand this concept and nobody could. You actually explained the function of '__init__' and 'self' instead of bluntly telling us to memories this. Thanks A TON! now i know when where to come when in doubt lmao
Corey. I have taken Java classes at a local university and I am a programmer from the 1980s. Classes really confused me when I took Java. Just couldn't get my head wrapped around the vocabulary. Your explanation was spot on. Thanks a great deal. Very appreciative of you taking the time to help folks like me.
Dude, you seriously used the wrong adjective there. Lucid lol. Also read this... Hi Corey can i ask you a question, why does every single one of these Java or Python videos basically make nothing? What i mean by that is, when people envision being a programmer, they imagine making their own program, with menus and buttons and shit to click on and fields to fill in and drop down menus etc, but literally every single Python or Java (or any language for that matter) just teaches you what a string is, what a short or long is, and how to assign a value to piece of data and to store it. Like adding names and ages to an array etc. But it's all in the Python compiler (or Java) window, and it's boring as hell, how come not one person has come on here and gone "Hey, you see this cool little program i have here that you can launch fro your desktop, and it can search your computer for any files you want, you just select the dowon menus and this tab and that tab and blah blah". Do you get me? Because If i hear one more person say "the best way to learn is just to ignore the tutorials and just sit there and try to code". But the problem is, thats impossible, as we're basically stuck, completely limited to that little Output window after you click the green arrow. I mean, do people really consider the fact that they just spent 40 minutes going through a bunch of strings and ints and how to link them to values etc, all to press the green button to get an ourput underneath that says "Orange, 141, Orange and Green, Orange, Green and Purple, 2948, Your answer was correct, your answer was incorrect" Do you get me? Im not gonna sit there after this 45 min lesson and think, "Ok thats awesome, now i can use the principle of this, and i can start to build my own little desktop application using the same resources as he was using, i can change certain things and instead of drop down boxes, i can have check boxes, and neat warning window that came up, i could totally customize that to do this and that". What you've really shown us (an i promise I'm not directing this specifically at you man) is how to type in expressions and how to print them in a box underneath without any errors. Man thats not programing or being creative, thats what everyon else did. How are we supposed to take the knowlege you/they gave us from that "int myResource = 2 +3; " and go ahead and build a desktop application, that when you open it, it asks you for your phone number and password you use to log into your phone providers online text messaging service for you without you having to go to the website yourself etc... Show me how to make an external program, with boxes, and windows and menus. I love what you're doing, just please expand for us, we know all this small stuff., If you're to be more successful, we need to know how to ACTUALLY make a program, where to get external data and forms and boxes and windows etc. Not like i sais "myValueOne + myValueTwo = Result;" you know? Again, I love you, but let's go man!!!
Tony Quigley I keep coming across the same problem. I’ve found UA-cam videos are more helpful than books, but I’ve still yet to see anything like what you described. Please comment back here if you find anything like that! Good call.
@@joshrobledo94 I was facing the same problem when I was just following tutorials. Tutorials teach how to code and how to use them right way but not actual program. I was wondering why no one teaches us to create a actual application with specific tutorial. But, you need to do that yourself. Just get a project in your mind and start building it and if that project requires if else then look for it and then create if else code for your program and after building lots of small program, you will get the idea why this type of tutorials are created. They just give you a sight, where you can use them but not complete application which you are looking for. Thanks!
I've been working on Udacity's full stack developer nanodegree program for the past couple of months. Up until now, classes have felt somewhat abstract and I definitely didn't understand the purpose of 'self'. The way you explained everything in this video was incredibly clear and now I feel like a have a more solid understanding of classes. Thanks so much!
Hello. I have watched quite a few videos explaining classes in Python and this one is the best. I like Your clarity of presentation. I've learned a lot. Thanks
Oh my god... I sat in class totally bewildered with this topic. I feel so much better having watched this. Thank you so very much Corey Schafer! You've got yourself one massive fangirl!
You are truely a genius, 'Self' parameter wasn't clear to me, I just remember it to use it but why it is there and what actually it does I didn't know, but now after saw your tutorials, its very clear to me. Thanks corey!
Best explanation of 'self' I ever heard. He covered the concept of class from so many different angles and he addressed all those question that a beginner asks while learning about the classes and especially 'self'.
oh Allah! this is beyond explanation, this man is from another planet which is good at explaining confused things like "self" hahhh in a more clear and concise way. i can't thank you enough man. i really appreciate it
you have a gift for explaining things. I've watched class explanations from 4 other channels and this is the clearest most concise I've seen. Thank you.
No, I'm not crying. How someone could explain this much good! 😭 Thanks Corey! I pledge to contribute whenever I'll make my first bread. Thanks again, worth a billion!
Corey! Corey! Corey! Corey! Corey! Corey! You are an impeccable teacher. No one focuses to teach the subtlety of the topic! And here you are, explaining every bit. Just, Love you Sir!
Дякую вельме шановному пану, за цю гарну можливість зрозуміти, шо то таке є за ООП. Обов'язково буду дивитися наступні відео. Ще й англійську підтягну))).
I have never had a problem understanding other people's accents. But when learning new content, new jargon, and new vocabulary understanding what is actually being said all of a sudden becomes impossible when paired with an Middle Eastern accent, for me anyway. THANK YOU!!! Corey Schafer = TRUE I am so thankful for your content sir, much appreciation!
What a great video, i have no words. Thank you Thank you Thank you!!! I just want to share 1 thing from goolge for those who might have some difficulties with the word instance. *An instance, in object-oriented programming (OOP), is a specific realization of any object. An object may be varied in a number of ways. Each realized variation of that object is an instance. The creation of a realized instance is called instantiation. Each time a program runs, it is an instance of that program. In languages that create objects from classes, an object is an instantiation of a class. That is, it is a member of a given class that has specified values rather than variables. In a non-programming context, you could think of "dog" as a class and your particular dog as an instance of that class.*
This 15 minutes long video is better and easier to understand than my school 1h long lecture! SERIOUSLY THANK YOU SO MUCH COREY! SUBSCRIBED LIKED SHARED FAVOURITE.
After the whole semester of object oriented programming, I finally fully understood the fundamentals of it. Love your tutorial! Going to watch the next one right away :) Thank you!
Thanks mate, been trying to understand OOP and watched dozens of videos and couldn't follow it until i saw your video. This was a great help. Thank you very much.
As a beginner with Python grappling with concepts and all the tutorials out there, your tutorials are a godsend. Thank you so much for these Corey. These are just friggin’ awesome. I would love to see a full app build project if you ever consider doing one. Nonetheless, thank you so much for these.
Very clear presentation,. I am finally understanding what all this "Class" stuff is about, after many failed attempts with other videos . At age 73 it takes me longer to absorb material, so I run it with many rewinds.
This is an amazing video that demystifies so many things about classes, that I read from different resources before, but still could not understand. I am truly grateful.
Tears from my eyes when I finally understood what "self" keyword here is all about. Thank You!!
Mirrors are miracles :D
Same here lol
Love from Chennai ❤️👌👍
Tears from my dong idk what's wrong
Same feeling
In my 3 years of trying to learn object-oriented Python, not a single teacher adequately explained what the "self" keyword was for -- until now. Thank you again Mr. Schafer!
If it's taken you three years, I'd just stop trying tbf.
dude 3years??
im so happy I watched this video 2 weeks in :)
One tutorial I used said "We'll explain this concept later" and just never addressed it again
3 yrs 😆
To everyone who is learning through Corey's channel. Do not ever doubt yourself whether you will land a job or not.
You will, because I did by watching his videos.
Thanks Corey. You are the best teacher.
That is AWESOME!!! So happy to hear you were able to land a job!
What specifically did you learn form this Channel ?
Python or else ?
@@ayeshavlogsfun Of course Python
@@occasionaltraveler Did you learn whole python from this Channel mean beginner to Advance ?
And what type of job are you doing using python ?
thanks for this motivation
Not all heros wear capes. Corey you are the man!
NO CAPES!
maybe he wears a cape, we haven't seen the guy.
That was the most fantastic explanation of classes I have ever seen. Thank you very much!
He actually wears a cape when he works. Also when he sleeps.
did you just assume that he doesnt wear a cape?
I honestly wish I just sat in my room and watched your videos rather than going to university. Much clearer and much cheaper and less stress.
Whats stopping you?
@@mrpanda7777 Sat is a past tense
what you study in college is more important than you think!
@@VMYE-ir6vw balls
@prostavse we are the same
✏ Notes
attributes = data,
methods = functions
Instance of a class
class variable , instance variable
🔖 Bookmarks
00:00 Introduction
00:33 Why use classes
01:09 A simple class
02:13 Class vs Instance
04:43 Initializing instance attributes with `__init__`
09:00 Custom instance methods
11:35 Common Mistake - Importance of passing `self`
14:25 Summary
ty
This tutorial about classes cannot be better. I really mean it, its just perfect. In my life i may have commented 3 videos here on youtube altogether, but this time i really needed to say THANK YOU, because you saved me lot of time, effort, and nerves. I am just looking forward to your other videos. Amazing work!
Awesome. Thanks, Michal!
its good to see that not only programmers or people who wanna learn watch these videos, but also morons do
Corey Schafer sir what application did you use? And how to download it for free? Thank you so much in advance :)
Michal Mikuláši what application is that sir? Is it notepad++?
John P Smith
You are better organized than some paid courses. Bravo !
*all paid courses.
@@niteshchauhan7775 Thanks God, I haven't tried them all, but you may well be right! Much better than Udemx....
Yeah. That's what I thought.
that's what i was gonna say 😂
@@meatyout Udemy is just awful. Pretty, packaged courses. No content.
Absolutely superb presentation! Worlds better (and more useful) than Udemy!
I honestly dont understand why people like this dont make udemy courses... Every second udemy course is just no explanations
Better than codeacademy too
ikrrr, I had a hard time understanding this through Jose
@@intothevode no wayyy
yes definitely!
I've just shown this video to my teacher. Now he's my student.
Laugh so hard for this...
this is the best comment so far
😂😂
Haha lol seriously??
Goru Kun you’re joking right? You didn’t seriously think this even happened
This series of lessons is honestly some of the best training I've ever seen. It's so clear and concise. The examples are perfect too. I'm writing this 4 years after they were released and they still hold up perfectly.
🎯 Key points for quick navigation:
00:00 *🏗️ Creación y uso de clases en Python*
- Las clases en Python permiten agrupar lógicamente datos y funciones para facilitar su reutilización y ampliación.
- Los atributos y métodos de una clase representan los datos y funciones asociados a la misma.
- En este video, aprenderemos los conceptos básicos de creación e instanciación de clases.
01:20 *📋 Creación de una clase simple: `Employee`*
- Ejemplo de una clase `Employee` que representa a los empleados de una empresa.
- Cada instancia de la clase `Employee` representa a un empleado específico con atributos únicos.
- Se puede utilizar una clase como plantilla para crear múltiples instancias con datos personalizados.
05:20 *🚀 Método especial `__init__` (constructor)*
- El método `__init__` se utiliza para inicializar las instancias de una clase con valores específicos.
- Permite definir cómo se deben configurar automáticamente los atributos de una instancia al ser creada.
- Los argumentos del método `__init__` corresponden a los valores que se desean asignar a los atributos de la instancia.
09:09 *🔄 Creación de métodos en una clase*
- Los métodos en una clase permiten definir acciones que pueden realizar las instancias de la clase.
- Proporcionan una forma organizada de agrupar funcionalidades relacionadas con la clase.
- Los métodos pueden acceder a los atributos de la instancia utilizando la referencia `self`.
Made with HARPA AI
Literally I was crying when I finally understand actual work of "self" keyword.
Saviour !!!
University professors should learn from you regarding " how to teach students". Love from India, sir.
Government funded bull shit. I can learn complex mathematics, science and physics online for free better then a $100,000 university degree could teach me.
Yes🎉
00:00 Introduction
00:33 Why use classes
01:09 A simple class
02:13 Class vs Instance
04:43 Initializing instance attributes with `__init__`
09:00 Custom instance methods
11:35 Importance of passing `self`
Link for this topic
People like you are why I graduated lmao
@@bucky5269 yup
good human
I don't know you but before recording this video, it is crystal clear that you asked yourself how can I be explaining better the concept of class/object to novice learners and you just nailed it. Huge thanks for great work man. We all humans should consider of adding perfectness to our professions. Cheers from Istanbul!
A month of confusion fixed in 15 minutes. Excellent job. Subbed.
2022 and still one of the most intuitive and relevant videos on OOP in UA-cam. Thanks Corey for this playlist, looking forward to complete the whole series within this week
Mate,
I have hit gold.
You legit explained OOP to me like it was so fucking simple.
OOP is easyly one of the hardest concepts in computer programming but you explained it in a way i think anyone can understand.
Thank you so much!
Awesome... that's nice to hear. Glad you found it useful!
I'm pretty sure I grasped the concept in the first 5 minutes, the pieces were finally coming together. Corey definitely made it sound so simple!
I have just started OOPs and every other videos I have watched , they were like “you have to use self, it is just the way”. Only u explained why it is there and for curious beginner that is very important.❤
exactly
It's there because the python inventors are weird like that.
It could simply be a keyword like in Java.
Then it would be: def set_first(first): self.first = first
This defiantly got my sub. People always seem to jump around, or leave things out, or mix terms when describing classes. This has been the most straightforward explanation I've come across.
This is the most clear explanation and demonstration on UA-cam, I paid 120$ for a python class and it’s not as clear as this. Good job man keep up the good work!
Any time I'm looking for a video explaining any coding stuff, it's always a bonus to find that Mr Schafer has the topic covered. Always good stuff from this guy. Clear diction, crystal clear explanations, pin sharp video, no silly background music, no lame attempts at humour or sounding cool, no dogs barking in the background, etc etc, just solid 100% no BS explanations and knowledge. Many Thanks.
I'd make more lame attempts at humor if I were funny haha. But thanks for the kind words... I appreciate it. Glad to hear you find the videos helpful.
Corey, thank you 1000 times! Very good explanation of object-oriented concept. Understanding self was a challenge and you were able to help it to sink in. Forever grateful!
I'd say that these details (how classes work, what instances are, what 'self' does and what happens in the background) are what distinguish basic and intermediate knowledge. And if you at least read some about it, you may detect similarities between different programming languages, and realize that it's often 'the same', but with a slightly different syntax. At least that's how i understand it. Thanks Corey, thank you for not being lazy (like me) and actually script, record, edit a video to help others understanding a topic which is very important.
i am completely beginner to coding.after started watching you're videos find coding is awesome.i have suggested these videos my other 3 colleagues to learn python basics.Gained lot confidence.Thank you.Thank you from India.
Have been searching all over the internet for a week to understand what classes are for and what is self here, this example was the best way to explain classes in python so far from videos and materials I have seen. Thank you.
I teach CS and Cory's channel is always my recommendation when a students needs supplemental material. Cory is my go to guy when I can't quite get through a particular student. Thank you Mr. Schafer for saving my butt more than a few times. Ironic note. I actually have a dog named Brooklyn lol
I can't believe it, impossible became possible. I now understood what is "self" thanks a lot man. Can't thank you enough.
Out of the many years I've watched videos about anything on UA-cam, I can count on my hands the number of times I've actually commented on a video. However, the way Corey explained Python OOP through this video, especially a week before my computer science exam, I just had to drop a comment. This is one of the best and most informative instructional videos I've ever seen, like ever even outside of computer science.
Well done!
loving it. I just started learning python and its my first programming language. I love how this guy explains new words like classes and instances in such a clear way!! thank you
i spend hours and hours on youtube to get a clear view and concept of "__init__" and "self" finally found this video. no words simply GREAT job done.
First time in history someone explains the concept of "Classes", "Instances" and "Self" is a way that can be understood!
I learnt more in this 15mins video than in my entire semester
Seems like you never payed a visit to your school
@@Arthurk346 i can confirm that some universities are so dumb that the statement above is true sometimes
Clearest explanation I've seen. Thank you!
no such thing as importax or not bout it, ts a toolx, nonex. no st as clear or not
Zes dude you good?
For an 8-year-old course, this is still very much relevant despite the fact that in IT a year is like a month. Thank you very much.
He deliberately made the mistake at 4:33 to show us how powerful classes are. Genius move. A true coder.
@@ShahyanBharucha30 Shut your mouth.
@@ShahyanBharucha30 Shut the fuck up, moron!
I thought so too ahah
@@dystopian_1 You is a punk!
@@af6727 No, you is.
Simple, concise and an amazing piece of work! Not only did I understand something I've been struggling to wrap my head around for a while, but I can now explain everything to my classmates too. Thanks a lot for making me look like some sort of Python Jedi.
No one can teach Classes in python better than this. Great tutorial for beginners. Thank you!!!
I've been learning Python as my first language for a few months now, but I got stuck and couldnt' grasp the concept of OOP via Python.
I started leaning OOP through books in Ruby, and I felt like the way it is presented in Ruby is SO much easier to comprehend compared to Python. I guess there's
a reason why OOP is usually introduced within the first three chapters of any Ruby textbook (forgiving syntax/true object oriented language) vice Python which teaches OOP in much much later chapters.
At any rate, once I understood the basics of OOP in Ruby (took like 2-3days).. the transition to Python OOP
was pretty easy.. It's essentialy all the same besides some terminology differences.
Great video and thanks :-)
What makes OOP in Ruby easier to comprehend ?
I would give the nobel prize for this explanation. Thank you Schafer.
"That's not extremely important to know" is such an understatement -- I can't believe how clearly you explained "self"! You are amazing.
THANK YOU! I just went through the OOP portion of a paid tutorial but still didn't feel comfortable with the content. So I search and found you. Great thoughtful and thorough explanation.
It's the plain English explanation of the difference between statements such as
A. Emp_1.fullname()
B. Employee.fullname(Emp_1)
that make the difference and sets your tutorials apart from the rest. Better than Netflix. I binge watch Corey tutorials
Thanks!
Instead of writing all that, just to get the employee fullname, you can just write:
print(emp_1.first + emp_1.last)
I tried for so long to understand classes and what is behind it: 15 minutes of your explanation and it made Click! Thx Corey Schafer!
Minute 13:00 of the tutorial is bliss, finally getting what the 'self' keyword really does. Thank you for that great explanation!
Self isn't a keyword. You could write anything else there.
That was actually a controversial topic, some python programmers being of the opinion that self should be a keyword in the language.
Finally a tutorial that doesn't try to use all kind of metaphors, but just explain it like it is. Thanks!
lol dude
Great clarity - showing the "long version" of emp_1.first = "Corey" and then how it translates into __init__ was really helpful, never occurred to me that was what was happening. Have heard many explanations of init but this is the first one that was clear and made sense to me, thank you Corey!
If only our universities were filled with professors like you.
God damn it! I feel as if I've wasted an entire year trying to learn something which you explained so easily and comfortably in 15 mins!!
Thank You for the wonderful explanation.
I remember trying to learn python ages ago and not being able to understand what the hell self was or why it was used. This video made it so god damn clear that I actually can't believe it was so simple.
OMG. I have been struggling to wrap my brain around all this, and you explained it so well! It's actually coming together now. Thank you so much!
I don't usually comment on UA-cam, but I just can't help to tell you how amazing your videos are. You are making programming exciting again for me! I am so glad to have found you! Thank you so much for making these videos!
I love how you go through examples of "manually" setting up classes and proceed to use the constructor with the INIT method. out of all the python videos this one explains it amazing. I also appreciate the way you explained class and instances and the differences.
Wow, you did a fantastic job explaining this concept! I am learning to code for the first time and was not able to fully grasp this material until I saw your video. Thank you so much. I look forward to watching more of your tutorials.
One of the best explanations of class instances available on UA-cam
I’ve never experienced such clarity, deep teaching intent and professionalism in my life . This was astounding
Without a doubt, the best explanation I have heard on class creation/usage in Python (or other OO languages), and how/why 'self' is used.
Most of the other videos/lessons I've gone through simply state something like, "Do it this way...because that's how it's done".
Your 15 minute explanation surpasses everything else I've seen on learning Python / OO programming.
Liked & Subscribed!
He doesn't explain why it's done that way though. It's kind of controversial as well, so you'd have to address different people's opinions to understand WHY there is this convention with "self".
honestly, i've been searching for a whole week websites and books to understand this concept and nobody could. You actually explained the function of '__init__' and 'self' instead of bluntly telling us to memories this. Thanks A TON! now i know when where to come when in doubt lmao
Same her! Boy was I struggling before these 15 minutes !
Corey. I have taken Java classes at a local university and I am a programmer from the 1980s. Classes really confused me when I took Java. Just couldn't get my head wrapped around the vocabulary. Your explanation was spot on. Thanks a great deal. Very appreciative of you taking the time to help folks like me.
Thank you! These Series Of Tutorials Are One of the Best Introductions To Classes And Their Usage In Python ! No Book Is This Lucid! _/\_
so true, than you Corey !
Dude, you seriously used the wrong adjective there. Lucid lol. Also read this...
Hi Corey can i ask you a question, why does every single one of these Java or Python videos basically make nothing?
What i mean by that is, when people envision being a programmer, they imagine making their own program, with menus and buttons and shit to click on and fields to fill in and drop down menus etc, but literally every single Python or Java (or any language for that matter) just teaches you what a string is, what a short or long is, and how to assign a value to piece of data and to store it.
Like adding names and ages to an array etc. But it's all in the Python compiler (or Java) window, and it's boring as hell, how come not one person has come on here and gone "Hey, you see this cool little program i have here that you can launch fro your desktop, and it can search your computer for any files you want, you just select the dowon menus and this tab and that tab and blah blah". Do you get me? Because If i hear one more person say "the best way to learn is just to ignore the tutorials and just sit there and try to code".
But the problem is, thats impossible, as we're basically stuck, completely limited to that little Output window after you click the green arrow.
I mean, do people really consider the fact that they just spent 40 minutes going through a bunch of strings and ints and how to link them to values etc, all to press the green button to get an ourput underneath that says "Orange, 141, Orange and Green, Orange, Green and Purple, 2948, Your answer was correct, your answer was incorrect"
Do you get me? Im not gonna sit there after this 45 min lesson and think, "Ok thats awesome, now i can use the principle of this, and i can start to build my own little desktop application using the same resources as he was using, i can change certain things and instead of drop down boxes, i can have check boxes, and neat warning window that came up, i could totally customize that to do this and that".
What you've really shown us (an i promise I'm not directing this specifically at you man) is how to type in expressions and how to print them in a box underneath without any errors.
Man thats not programing or being creative, thats what everyon else did.
How are we supposed to take the knowlege you/they gave us from that "int myResource = 2 +3; " and go ahead and build a desktop application, that when you open it, it asks you for your phone number and password you use to log into your phone providers online text messaging service for you without you having to go to the website yourself etc...
Show me how to make an external program, with boxes, and windows and menus.
I love what you're doing, just please expand for us, we know all this small stuff., If you're to be more successful, we need to know how to ACTUALLY make a program, where to get external data and forms and boxes and windows etc. Not like i sais "myValueOne + myValueTwo = Result;" you know?
Again, I love you, but let's go man!!!
Tony Quigley I keep coming across the same problem. I’ve found UA-cam videos are more helpful than books, but I’ve still yet to see anything like what you described. Please comment back here if you find anything like that! Good call.
@@joshrobledo94 I was facing the same problem when I was just following tutorials. Tutorials teach how to code and how to use them right way but not actual program.
I was wondering why no one teaches us to create a actual application with specific tutorial.
But, you need to do that yourself. Just get a project in your mind and start building it and if that project requires if else then look for it and then create if else code for your program and after building lots of small program, you will get the idea why this type of tutorials are created.
They just give you a sight, where you can use them but not complete application which you are looking for.
Thanks!
@@tonyquigley6543 It's called a GUI and there are billions of tutorials that teach you how to make them.
My work-colleague told me about your tutorials on UA-cam. I am gonna buy that colleague a coffee.
also a paypal donation to corey
while you're at it get me a hot chocolate too. thx
is it too late to ask for a pizza for the boys at our corner of the office?
Oh my! I’ve been writing Python code for a few months now. I’ve learned a lot, but this! This is gold. Game changer.
I've been working on Udacity's full stack developer nanodegree program for the past couple of months. Up until now, classes have felt somewhat abstract and I definitely didn't understand the purpose of 'self'. The way you explained everything in this video was incredibly clear and now I feel like a have a more solid understanding of classes. Thanks so much!
The "self" is controversial among python programmers: some think it should be a keyword rather than a convention.
Hello. I have watched quite a few videos explaining classes in Python and this one is the best. I like Your clarity of presentation. I've learned a lot. Thanks
Oh my god... I sat in class totally bewildered with this topic. I feel so much better having watched this. Thank you so very much Corey Schafer! You've got yourself one massive fangirl!
after many trials to learn that "self" thingy, now i understand it after watching your video. my 3 remaining brain cells thank you
Audi Farizka LoL, I can relate to that “3 remaining brain cells” 🤣
@@williambridge9521 studying computation is tough lol
You are truely a genius, 'Self' parameter wasn't clear to me, I just remember it to use it but why it is there and what actually it does I didn't know, but now after saw your tutorials, its very clear to me. Thanks corey!
Best explanation of 'self' I ever heard. He covered the concept of class from so many different angles and he addressed all those question that a beginner asks while learning about the classes and especially 'self'.
My teacher took whole semester for this still I wanted to withdraw but this guy here.......did that in 15 min Dayum!
The most well explained lesson about classes and instances, i've ever heard. i finally got it
Thanks Corey...u'r the best
oh Allah! this is beyond explanation, this man is from another planet which is good at explaining confused things like "self" hahhh in a more clear and concise way. i can't thank you enough man. i really appreciate it
I also think this was great. Not only do you explain how to do it, you give an example of how to do it, and ALSO give reasons for WHY to do it.
you have a gift for explaining things. I've watched class explanations from 4 other channels and this is the clearest most concise I've seen. Thank you.
here too!
No, I'm not crying. How someone could explain this much good! 😭 Thanks Corey! I pledge to contribute whenever I'll make my first bread. Thanks again, worth a billion!
Brilliant stuff! So clear and very well presented because there's no extra talking or fluff - straight to the point.
This is the most amazing tutorial/ explanation on introduction to classes in python on the whole of UA-cam. Thank you so much
Please please make more videos! Never understood these concepts THIS clearly before. You are helping millions! God bless you man
Sir I finally master stuffs of object oriented. Thanks a lot for great help.
You deserve best youtuber.
Some people walk around earth without a purpose. But, Corey is sharing his purpose !
Corey! Corey! Corey! Corey! Corey! Corey! You are an impeccable teacher. No one focuses to teach the subtlety of the topic! And here you are, explaining every bit. Just, Love you Sir!
clear, efficient, short, so what else should we expect. thanks a lot man, you are the best
BEAST tutorials! Best I've seen on youTube, hands down!
Дякую вельме шановному пану, за цю гарну можливість зрозуміти, шо то таке є за ООП. Обов'язково буду дивитися наступні відео. Ще й англійську підтягну))).
The "self" explanation is what makes the video more valuable. 😊
You're a better teacher than my CompSci Prof, dude! THANK YOU!!
I have never had a problem understanding other people's accents. But when learning new content, new jargon, and new vocabulary understanding what is actually being said all of a sudden becomes impossible when paired with an Middle Eastern accent, for me anyway. THANK YOU!!!
Corey Schafer = TRUE
I am so thankful for your content sir, much appreciation!
Thank God I landed on your channel, this is one of the best series for learning OOP.
""SELF"" the biggest mystery finally solved
same here
for mee too
yes
What a great video, i have no words. Thank you Thank you Thank you!!!
I just want to share 1 thing from goolge for those who might have some difficulties with the word instance.
*An instance, in object-oriented programming (OOP), is a specific realization of any object. An object may be varied in a number of ways. Each realized variation of that object is an instance. The creation of a realized instance is called instantiation.
Each time a program runs, it is an instance of that program. In languages that create objects from classes, an object is an instantiation of a class. That is, it is a member of a given class that has specified values rather than variables. In a non-programming context, you could think of "dog" as a class and your particular dog as an instance of that class.*
This 15 minutes long video is better and easier to understand than my school 1h long lecture!
SERIOUSLY THANK YOU SO MUCH COREY!
SUBSCRIBED LIKED SHARED FAVOURITE.
After the whole semester of object oriented programming, I finally fully understood the fundamentals of it. Love your tutorial! Going to watch the next one right away :) Thank you!
Thanks mate, been trying to understand OOP and watched dozens of videos and couldn't follow it until i saw your video. This was a great help. Thank you very much.
As a beginner with Python grappling with concepts and all the tutorials out there, your tutorials are a godsend. Thank you so much for these Corey. These are just friggin’ awesome. I would love to see a full app build project if you ever consider doing one. Nonetheless, thank you so much for these.
I agree with you @Burner918 ...."your tutorials are a godsend"
Happy Guru Poornima, Corey!
(It's the day we salute our Teacher's for there efforts to make us knowledgeable).
That’s sounds like a great day.
Very clear presentation,. I am finally understanding what all this "Class" stuff is about, after many failed attempts with other videos . At age 73 it takes me longer to absorb material, so I run it with many rewinds.
Watching all the ads so you never stop making videos.. Thanks so much for the great content!!
The explanation of 'self' releases a lot of confusion, thank you Corey.
This is an amazing video that demystifies so many things about classes, that I read from different resources before, but still could not understand. I am truly grateful.
Extremely good video. You just made me understand classes which had confounded me for a long time. Thank you!!