Python OOP Tutorial 1: Classes and Instances

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 3,8 тис.

  • @prashanthib4488
    @prashanthib4488 4 роки тому +5013

    Tears from my eyes when I finally understood what "self" keyword here is all about. Thank You!!

  • @kerwinso
    @kerwinso 4 роки тому +1744

    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!

    • @oc4026
      @oc4026 4 роки тому +31

      If it's taken you three years, I'd just stop trying tbf.

    • @forgandorgan7552
      @forgandorgan7552 4 роки тому +29

      dude 3years??

    • @sebastianskopek
      @sebastianskopek 4 роки тому +9

      im so happy I watched this video 2 weeks in :)

    • @jadedaniels5076
      @jadedaniels5076 3 роки тому +25

      One tutorial I used said "We'll explain this concept later" and just never addressed it again

    • @copyrightedchannel4939
      @copyrightedchannel4939 3 роки тому +1

      3 yrs 😆

  • @occasionaltraveler
    @occasionaltraveler 3 роки тому +568

    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.

    • @dereckwbii3504
      @dereckwbii3504 3 роки тому +15

      That is AWESOME!!! So happy to hear you were able to land a job!

    • @ayeshavlogsfun
      @ayeshavlogsfun 3 роки тому +3

      What specifically did you learn form this Channel ?
      Python or else ?

    • @occasionaltraveler
      @occasionaltraveler 3 роки тому +8

      @@ayeshavlogsfun Of course Python

    • @ayeshavlogsfun
      @ayeshavlogsfun 3 роки тому +2

      @@occasionaltraveler Did you learn whole python from this Channel mean beginner to Advance ?
      And what type of job are you doing using python ?

    • @fagbenromodupeola3095
      @fagbenromodupeola3095 2 роки тому

      thanks for this motivation

  • @felipeporto2758
    @felipeporto2758 8 років тому +2492

    Not all heros wear capes. Corey you are the man!

    • @theweirdpartofyoutube8662
      @theweirdpartofyoutube8662 7 років тому +25

      NO CAPES!

    • @sarthak0diwan
      @sarthak0diwan 7 років тому +60

      maybe he wears a cape, we haven't seen the guy.

    • @Jonathan-od5xc
      @Jonathan-od5xc 7 років тому +14

      That was the most fantastic explanation of classes I have ever seen. Thank you very much!

    • @ashfaqrahman2795
      @ashfaqrahman2795 6 років тому +5

      He actually wears a cape when he works. Also when he sleeps.

    • @786Inferno
      @786Inferno 6 років тому +2

      did you just assume that he doesnt wear a cape?

  • @TrungNguyen-ld7hz
    @TrungNguyen-ld7hz 5 років тому +902

    I've just shown this video to my teacher. Now he's my student.

  • @keenzeen
    @keenzeen 2 роки тому +40

    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.❤

    • @sagnikkayal782
      @sagnikkayal782 Рік тому

      exactly

    • @MrCmon113
      @MrCmon113 Рік тому +1

      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

  • @vclarke4433
    @vclarke4433 6 років тому +558

    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.

    • @mrpanda7777
      @mrpanda7777 5 років тому +2

      Whats stopping you?

    • @hoseam4537
      @hoseam4537 5 років тому +38

      @@mrpanda7777 Sat is a past tense

    • @VMYE-ir6vw
      @VMYE-ir6vw 5 років тому +4

      what you study in college is more important than you think!

    • @sed4454
      @sed4454 5 років тому +3

      @@VMYE-ir6vw balls

    • @khinethurein7336
      @khinethurein7336 5 років тому

      @prostavse we are the same

  • @yogeshkumarshankariya642
    @yogeshkumarshankariya642 4 роки тому +265

    University professors should learn from you regarding " how to teach students". Love from India, sir.

    • @rebelgordo2339
      @rebelgordo2339 2 роки тому

      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.

    • @ajithajith3803
      @ajithajith3803 Рік тому

      Yes🎉

  • @shashankbangera7753
    @shashankbangera7753 2 роки тому +20

    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

  • @sanmulty
    @sanmulty 7 років тому +263

    You are better organized than some paid courses. Bravo !

    • @niteshchauhan7775
      @niteshchauhan7775 5 років тому +11

      *all paid courses.

    • @meatyout
      @meatyout 5 років тому

      @@niteshchauhan7775 Thanks God, I haven't tried them all, but you may well be right! Much better than Udemx....

    • @kircyclone
      @kircyclone 5 років тому

      Yeah. That's what I thought.

    • @Shivam_Manswalia
      @Shivam_Manswalia 4 роки тому

      that's what i was gonna say 😂

    • @kristypolymath1359
      @kristypolymath1359 4 роки тому

      @@meatyout Udemy is just awful. Pretty, packaged courses. No content.

  • @michalmikulasi5193
    @michalmikulasi5193 8 років тому +265

    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!

    • @coreyms
      @coreyms  8 років тому +43

      Awesome. Thanks, Michal!

    • @michalmikulasi5193
      @michalmikulasi5193 7 років тому +3

      its good to see that not only programmers or people who wanna learn watch these videos, but also morons do

    • @evelynpunzalan4606
      @evelynpunzalan4606 6 років тому

      Corey Schafer sir what application did you use? And how to download it for free? Thank you so much in advance :)

    • @evelynpunzalan4606
      @evelynpunzalan4606 6 років тому

      Michal Mikuláši what application is that sir? Is it notepad++?

    • @ananthvankipuram4012
      @ananthvankipuram4012 6 років тому

      John P Smith

  • @hadiakbary410
    @hadiakbary410 6 місяців тому +2

    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.

  • @salbayrak
    @salbayrak 5 років тому +82

    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!

  • @HamroMotors
    @HamroMotors 4 роки тому +19

    Literally I was crying when I finally understand actual work of "self" keyword.
    Saviour !!!

  • @jarrettguthrie1670
    @jarrettguthrie1670 Рік тому +1

    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.

  • @nickmarshallvfx
    @nickmarshallvfx 4 роки тому +41

    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.

  • @danverzhao9912
    @danverzhao9912 4 роки тому +8

    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!

  • @darkscienceyt
    @darkscienceyt 3 роки тому +473

    Absolutely superb presentation! Worlds better (and more useful) than Udemy!

    • @runningforver5958
      @runningforver5958 3 роки тому +20

      I honestly dont understand why people like this dont make udemy courses... Every second udemy course is just no explanations

    • @intothevode
      @intothevode 3 роки тому +10

      Better than codeacademy too

    • @harshitaseeja3290
      @harshitaseeja3290 3 роки тому +6

      ikrrr, I had a hard time understanding this through Jose

    • @jaylooppworld381
      @jaylooppworld381 3 роки тому +1

      @@intothevode no wayyy

    • @zackerystarling2352
      @zackerystarling2352 3 роки тому +1

      yes definitely!

  • @sylargray8913
    @sylargray8913 7 років тому +78

    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!

    • @coreyms
      @coreyms  7 років тому +12

      Awesome... that's nice to hear. Glad you found it useful!

    • @lilfoxxxx5785
      @lilfoxxxx5785 6 років тому +2

      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!

  • @sreekanthreddylingamdinne363
    @sreekanthreddylingamdinne363 7 років тому +22

    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.

  • @infofast7326
    @infofast7326 3 роки тому +1

    First time in history someone explains the concept of "Classes", "Instances" and "Self" is a way that can be understood!

  • @rogerwilco6725
    @rogerwilco6725 5 років тому +65

    A month of confusion fixed in 15 minutes. Excellent job. Subbed.

  • @samdavepollard
    @samdavepollard 7 років тому +5

    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.

    • @coreyms
      @coreyms  7 років тому +2

      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.

  • @ndeoligence8
    @ndeoligence8 3 роки тому +174

    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`

  • @tobilliontv7276
    @tobilliontv7276 5 років тому +157

    I learnt more in this 15mins video than in my entire semester

    • @Arthurk346
      @Arthurk346 4 роки тому +5

      Seems like you never payed a visit to your school

    • @88Timur88Bahmudov88
      @88Timur88Bahmudov88 4 роки тому +6

      @@Arthurk346 i can confirm that some universities are so dumb that the statement above is true sometimes

  • @maniece100
    @maniece100 4 роки тому +14

    I can't believe it, impossible became possible. I now understood what is "self" thanks a lot man. Can't thank you enough.

  • @1_and_only_Crjase
    @1_and_only_Crjase 3 роки тому +1

    Instead of writing all that, just to get the employee fullname, you can just write:
    print(emp_1.first + emp_1.last)

  • @tomduda1
    @tomduda1 4 роки тому +69

    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

  • @Eren-qo1lu
    @Eren-qo1lu 4 роки тому +5

    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.

  • @hughlilly
    @hughlilly 3 роки тому +1

    "That's not extremely important to know" is such an understatement -- I can't believe how clearly you explained "self"! You are amazing.

  • @taimooralibukhari
    @taimooralibukhari 7 років тому +31

    My teacher took whole semester for this still I wanted to withdraw but this guy here.......did that in 15 min Dayum!

  • @zulfi1
    @zulfi1 7 років тому +4

    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.

  • @rolfedrengen
    @rolfedrengen 2 роки тому +8

    Finally a tutorial that doesn't try to use all kind of metaphors, but just explain it like it is. Thanks!

  • @davidalexander829
    @davidalexander829 5 років тому +5

    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

  • @af6727
    @af6727 4 роки тому +52

    He deliberately made the mistake at 4:33 to show us how powerful classes are. Genius move. A true coder.

    • @af6727
      @af6727 4 роки тому +1

      @@ShahyanBharucha30 Shut your mouth.

    • @dystopian_1
      @dystopian_1 4 роки тому +2

      @@ShahyanBharucha30 Shut the fuck up, moron!

    • @IoniB
      @IoniB 4 роки тому

      I thought so too ahah

    • @af6727
      @af6727 4 роки тому

      @@dystopian_1 You is a punk!

    • @dystopian_1
      @dystopian_1 4 роки тому

      @@af6727 No, you is.

  • @manish-gupta
    @manish-gupta 2 роки тому +7

    No one can teach Classes in python better than this. Great tutorial for beginners. Thank you!!!

  • @basetroll1627
    @basetroll1627 5 років тому +4

    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!

  • @cheikhoudiallo1560
    @cheikhoudiallo1560 5 років тому +6

    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

  • @vigneshn_learning
    @vigneshn_learning 2 роки тому +162

    ✏ 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

  • @HaileeMiu
    @HaileeMiu 5 років тому +7

    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.

  • @amithpandit4043
    @amithpandit4043 5 років тому +151

    My work-colleague told me about your tutorials on UA-cam. I am gonna buy that colleague a coffee.

    • @syedabdulsalam4659
      @syedabdulsalam4659 5 років тому +29

      also a paypal donation to corey

    • @atikshsingh1598
      @atikshsingh1598 5 років тому +8

      while you're at it get me a hot chocolate too. thx

    • @EthanDyTioco
      @EthanDyTioco 3 роки тому

      is it too late to ask for a pizza for the boys at our corner of the office?

  • @sketchfam8037
    @sketchfam8037 9 місяців тому

    I’ve never experienced such clarity, deep teaching intent and professionalism in my life . This was astounding

  • @jmack6046
    @jmack6046 8 років тому +10

    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 :-)

    • @hv1461
      @hv1461 5 років тому

      What makes OOP in Ruby easier to comprehend ?

  • @angadsingh6478
    @angadsingh6478 4 роки тому +142

    ""SELF"" the biggest mystery finally solved

  • @khorshedalam1589
    @khorshedalam1589 2 роки тому +5

    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!

  • @chenlmbd
    @chenlmbd 5 років тому +22

    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!

  • @AMINE-yy3zb
    @AMINE-yy3zb 6 років тому +23

    I would give the nobel prize for this explanation. Thank you Schafer.

  • @SalahuddinTariq-v5x
    @SalahuddinTariq-v5x 11 місяців тому

    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'.

  • @mocoebabymom
    @mocoebabymom 4 роки тому +26

    after many trials to learn that "self" thingy, now i understand it after watching your video. my 3 remaining brain cells thank you

    • @williambridge9521
      @williambridge9521 4 роки тому +3

      Audi Farizka LoL, I can relate to that “3 remaining brain cells” 🤣

    • @mocoebabymom
      @mocoebabymom 4 роки тому

      @@williambridge9521 studying computation is tough lol

  • @KyleChiversC
    @KyleChiversC 8 років тому +5

    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!

    • @MrCmon113
      @MrCmon113 Рік тому

      The "self" is controversial among python programmers: some think it should be a keyword rather than a convention.

  • @julia_orchid_cali
    @julia_orchid_cali Рік тому +37

    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!

  • @TheValkire
    @TheValkire 4 роки тому +7

    Minute 13:00 of the tutorial is bliss, finally getting what the 'self' keyword really does. Thank you for that great explanation!

    • @MrCmon113
      @MrCmon113 Рік тому

      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.

  • @LacksonMunthali
    @LacksonMunthali 4 роки тому +5

    The "self" explanation is what makes the video more valuable. 😊

  • @isaiahlopez51
    @isaiahlopez51 Рік тому +2

    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.

  • @ismailniyaz5167
    @ismailniyaz5167 4 роки тому +11

    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.

  • @jessesinger4790
    @jessesinger4790 7 років тому +4

    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.

  • @muneebrehman7463
    @muneebrehman7463 11 місяців тому +1

    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!

  • @therevivalknight4678
    @therevivalknight4678 5 років тому +6

    One of the best explanations of class instances available on UA-cam

  • @jowangify
    @jowangify 5 років тому +4

    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!

  • @karasu5354
    @karasu5354 2 роки тому +2

    I took the class about a year ago and was confused what "self" is until now, thanks bro, you literally teaches better than university professors

  • @deboparnabanerjee4185
    @deboparnabanerjee4185 5 років тому +4

    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

    • @basetroll1627
      @basetroll1627 5 років тому

      Same her! Boy was I struggling before these 15 minutes !

  • @HarshitTewari20
    @HarshitTewari20 5 років тому +14

    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.

  • @shawnsweeney117
    @shawnsweeney117 4 роки тому +1

    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.

  • @castroislivingonearth
    @castroislivingonearth 4 роки тому +8

    Some people walk around earth without a purpose. But, Corey is sharing his purpose !

  • @EduljiBharucha
    @EduljiBharucha 8 років тому +109

    Clearest explanation I've seen. Thank you!

    • @zes7215
      @zes7215 6 років тому

      no such thing as importax or not bout it, ts a toolx, nonex. no st as clear or not

    • @bakhshizulfiqarmanzur8988
      @bakhshizulfiqarmanzur8988 5 років тому

      Zes dude you good?

  • @karimwaziri791
    @karimwaziri791 3 роки тому

    You are still highly recommended in 2021.
    love and respect from Afghanistan.

  • @blazejp6204
    @blazejp6204 7 років тому +9

    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

  • @manikandank3931
    @manikandank3931 8 років тому +164

    print("thank you")

    • @majabojarska4821
      @majabojarska4821 5 років тому +13

      @alexandru dumitru It's necessary to escape the inner double quotes like this, otherwise there will be a SyntaxError ^_^
      response = input("*INSERT \"NICE\"*")

    • @valaks36
      @valaks36 5 років тому

      @alexandru dumitru lmao

    • @VictorOlet
      @VictorOlet 5 років тому

      @@majabojarska4821 No sleeping on syntax out here 🙌

    • @tramquangpho
      @tramquangpho 5 років тому

      Maja Bojarska .

  • @zaidzabeite7750
    @zaidzabeite7750 3 роки тому +2

    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

  • @samandrew8158
    @samandrew8158 5 років тому +6

    You're a better teacher than my CompSci Prof, dude! THANK YOU!!

  • @SparknShow
    @SparknShow 6 років тому +5

    I learned more in this 15 minute video than a week of class. You saved me😥

  • @manikandansrinivasan9816
    @manikandansrinivasan9816 3 роки тому +1

    You are the only reason I am learning Python.. You are teaching stuff what my college couldn't do in a year

  • @adetolaadedeji7273
    @adetolaadedeji7273 4 роки тому +42

    For what I learnt from the video,
    Class I_say:
    def __init__(self, first, second):
    self.first = first
    self.second = second
    self.summary = first + " " + second
    Yeah = I_say('Corey Schafer', 'Thank You')
    print(Yeah.summary)

  • @pxscrill
    @pxscrill 4 роки тому +9

    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!

  • @Qelacien
    @Qelacien 2 роки тому

    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.*

  • @Zero11_ss
    @Zero11_ss 5 років тому +5

    I think your the only person who actually explained to me what self is

  • @ralf1273
    @ralf1273 5 років тому +10

    The most well explained lesson about classes and instances, i've ever heard. i finally got it
    Thanks Corey...u'r the best

  • @mohammedmahmod1702
    @mohammedmahmod1702 Рік тому +1

    leanrt so many things from this video but i had to repeat your video few times to understand it better. thank you

  • @juliusarceo3800
    @juliusarceo3800 5 років тому +17

    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.

  • @virendrakumarsoni621
    @virendrakumarsoni621 3 роки тому +3

    It's been 4 years but, still best video on classes

  • @bryan192
    @bryan192 2 роки тому

    Self taught python coder here. Probably the best made video about classes ever

  • @petrahrabakova752
    @petrahrabakova752 3 роки тому +3

    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!

  • @claaaaams
    @claaaaams 4 роки тому +4

    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.

  • @lionatticus9743
    @lionatticus9743 2 роки тому

    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.

  • @jaxwylde2139
    @jaxwylde2139 4 роки тому +33

    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!

    • @MrCmon113
      @MrCmon113 Рік тому

      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".

  • @EdenSignal
    @EdenSignal 4 роки тому +4

    The explanation of 'self' releases a lot of confusion, thank you Corey.

  • @alexandre2245
    @alexandre2245 2 роки тому +1

    I just spent 2h reading the stupid book that my school provided, this is so much clearer ffs thank you so much you are amazing…

  • @kabirajadhikari2092
    @kabirajadhikari2092 5 років тому +5

    Sir I finally master stuffs of object oriented. Thanks a lot for great help.
    You deserve best youtuber.

  • @robusgauli9502
    @robusgauli9502 8 років тому +61

    Hi Corey, It would be blessing to this world if you could make full in depth tutorials with a learning curve so that I can follow yout videos from beginners to expert. Thank you so much!!

    • @coreyms
      @coreyms  8 років тому +54

      I've been meaning to order my videos in order from beginner to advanced for some time. I will get to work on that. Thanks for the feedback!

    • @robusgauli9502
      @robusgauli9502 8 років тому +38

      woo!! I was searching the entire web for the best tutorials in python and clearly you win it. Your videos are more about "Why to do " rather than "How to do". I think that is the best thing about your videos which makes you stand out of the crowd. It would be awesome if you could do the zero to hero type tutorials.

    • @BeYakko1
      @BeYakko1 8 років тому

      this would be awesome

    • @MyTube4Utoo
      @MyTube4Utoo 7 років тому

      +robus gauli I agree! I've been trying to learn Python programming far longer than I'd ever admit, and I thought I'd seen most of the decent videos on YT, but I was suddenly blessed with finding Corey's! He doesn't have to go at a snail's pace, but he's just able to get the message through, somehow. Most others get lost in translation, or something, at least for me. Classes/Objects always confused me for some reason, but here it was 'almost' like using the print function to display 'Hello World.' lol

  • @tede1838
    @tede1838 4 роки тому

    your vid's have become my first and last stop for programming knowledge on UA-cam. they never fail to clear up my understanding of each concept.

  • @aaronhunter5464
    @aaronhunter5464 8 років тому +72

    this made me realize that I actually don't know how classes work

  • @donaldkeith139
    @donaldkeith139 3 роки тому +5

    Brilliant stuff! So clear and very well presented because there's no extra talking or fluff - straight to the point.

  • @BinswangersDisease
    @BinswangersDisease 4 роки тому

    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.

  • @burner918
    @burner918 4 роки тому +5

    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.

    • @hi5god854
      @hi5god854 Рік тому

      I agree with you @Burner918 ...."your tutorials are a godsend"

  • @marckhycs319
    @marckhycs319 4 роки тому +6

    finally!! someone explained the mystery of "self"🤗

  • @itsmr.salient7184
    @itsmr.salient7184 3 роки тому

    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!

  • @akshatgarg6635
    @akshatgarg6635 4 роки тому +4

    after 5 year, now i finally understood the concept of self in python

  • @vitaminwater6235
    @vitaminwater6235 5 років тому +4

    Bro, I'm taking a Python Class and you have taught me more than my instructor has. Lol thank you sir

  • @terrimotherof4089
    @terrimotherof4089 3 роки тому

    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!

  • @hassanmuhammad8520
    @hassanmuhammad8520 5 років тому +9

    This is the most amazing tutorial/ explanation on introduction to classes in python on the whole of UA-cam. Thank you so much