Python OOP Tutorial 2: Class Variables

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

Комментарии • 1,5 тыс.

  • @mtvcity2
    @mtvcity2 7 лет назад +2930

    Your videos are more informative than my university lectures

    • @coreyms
      @coreyms  7 лет назад +266

      Thanks a lot! That's a nice compliment. I'm glad to hear you find them useful.

    • @silverzero9524
      @silverzero9524 7 лет назад +52

      and short and arent booooooring

    • @MrZhunio
      @MrZhunio 7 лет назад +56

      This is so true. We obtain more information on those really short videos than we do in those long lectures on universities.

    • @adityaverma6120
      @adityaverma6120 7 лет назад +33

      True Story of every university

    • @nicklesmatsch7588
      @nicklesmatsch7588 6 лет назад +24

      Well, kind of. In your videos we learn basically all the useful stuff we want to know, but in university we get all the side-information (sorry, no native speaker) we may find useful someday, even though we don't know yet, when it could happen.

  • @팍준하
    @팍준하 4 года назад +803

    Summary:
    In this video, Corey taught as how to differentiate between a Class variable and instance variable, how they are related to each, other, and when each of them is more useful over the other.
    Class variables are variables that we set inside a class, and are shared among all instances. Corey gave a good example where the number of total employs should be the same to every employ, no matter which employee we are referring to. Therefore,
    emp_1.num_of_employ = emp_2.num_of_employ = Employee.num_of_employ
    Instance variables are variables that are different from each instance. For example, the names and the pay for each employee. They have to be different.
    Corey also shows that class variables and instance variables are closely related, and that class variables are kind of 'inherited' to the 'self' variables. To illustrate this, Corey shows an example of 'annual raise of pay'. He initially creates the class variable to show a case where annual raise is equal among all the employees. This variable of 1.04 was accessible through each instance, and also through the class itself(obiviously). That is,
    print(Employee.annual_raise)
    print(emp_1.annual_raise)
    print(emp_2.anual_rais)
    all printed out 1.04.
    However, using the .__dict___ thing, Corey shows that the intances, emp_1 and emp_2 does not contain the annual_raise value. Corey explains that if a variable is not found within an instance and programmers try to access the variable, python automatically looks in in the variable of the instance's class, and then the more classes that the instance's class inherits from.
    Furthermore, if we access the class variable through an instance and then change it, python creates the variable within the instance. We can check it by using the .__dict__ thing. Corey shows that annual_raise key was created when he manually changed the annual_raise value as 1.05 in the following way.
    emp_1.annual_raise = 1.05
    however, we know that the class variable remained the same at 1.04, when printing the class variable.
    print(Employee.annual_raise)
    ==> 1.04

    • @marflage
      @marflage 4 года назад +49

      Thank you so much. I wanted to revise everything he said but did not want to watch the entire video again. Your comment helped me with just.

    • @amansinghal2431
      @amansinghal2431 4 года назад +18

      in the second para you said that class variables are shared among all instances but I dont think thats the case. Corey said pyhton first searches the variables in the instance but if it doesnt find it, it goes to the class of the instance and returns it from their. if you dont explicitly mention emp1.raise_amount = 1.05, emp1 instance doesnt have the raise_amount vriables. Please confirm

    • @infinitedeathloop5517
      @infinitedeathloop5517 4 года назад +10

      @@amansinghal2431 I think he means, when the raise_amount variable isn't found in the instances, python searches for the instance in the class and applies it to both the instances, thus making them share the same variable. I hope I was clear

    • @nishantthakur5357
      @nishantthakur5357 4 года назад

      Thankx a lot mate

    • @aniruddhkhare2080
      @aniruddhkhare2080 4 года назад +9

      @@amansinghal2431 The fact that class variables are shared among instances is correct. When class variables are used in methods using class names (as in Employee.raise_amount), then python directly accesses the class namespace, which is common for every instance. But when self is used (as in self.raise_amount), then python first searches the object's namespace, and if not found, then the class namespace. That's why Corey states that using self allows to assign different class variable values to different objects, as reassigning them (such as self.raise_amount = 1.05), makes the value a part of the object's namespace which is queried first.

  • @trevorduncan7913
    @trevorduncan7913 7 лет назад +915

    it really makes a difference who teaches you.....it was wtf wtf wtf....then watch these videos...oh ya that's logical. you are an awesome teacher....please keep the videos coming.

    • @charlesbovalis6591
      @charlesbovalis6591 5 лет назад +5

      Indeed - a "GOOD" teacher is PRICELESS !!!!!!

    • @ismailmatrix1
      @ismailmatrix1 3 года назад +8

      I noticed he uses a lot of printing to explain things. That's why it seems logical. When in doubt, just print it out!

    • @selehadinhabesi3855
      @selehadinhabesi3855 3 года назад +1

      well said, a teacher can kill or instill in you a love for a subject

  • @HaroonAshrafAwan
    @HaroonAshrafAwan 6 лет назад +318

    I enrolled into a top seller's python course on Udemy, read from some of the famous websites but I didn't find someone who teaches like you.You are, hands down, the best teacher anyone can have.

  • @charlesdeleau3086
    @charlesdeleau3086 4 года назад +84

    This is so good that I'm starting to doubt whether all his 'mistakes' are secretly ways to make us learn faster :P

  • @derricknjoroge2494
    @derricknjoroge2494 6 лет назад +87

    You have the best python OOP tutorials. Thank you, you are helping alot of people especially aspiring developers from
    Africa. Cheers

    • @coreyms
      @coreyms  6 лет назад +5

      That's great to hear! Glad you found it helpful!

    • @jeremyokuto9856
      @jeremyokuto9856 4 года назад

      Actually from the same country bro

  • @sunnybeta_
    @sunnybeta_ 7 лет назад +558

    you helped me get an internship. :*

    • @coreyms
      @coreyms  7 лет назад +97

      Congratulations!

    • @Asterite
      @Asterite 5 лет назад +12

      @@robbyz512 for experience and understanding , thats simple even tho i wasnt in any internship :p you are basically learning how to work in that level

    • @Asterite
      @Asterite 5 лет назад +3

      @@robbyz512 i think you are paid man not like alot but still

    • @Asterite
      @Asterite 5 лет назад

      @Berke Icel oh still also a good way for experience :3

    • @nomadfox9290
      @nomadfox9290 5 лет назад +16

      @Berke Icel That's not entirely true (not being payed for internships). I actually was paid for an internship I did before I was hired on after it was over. I know for a fact the big companies like Facebook, Microsoft, Google, Twitter, etc. pay interns via an educational stipend.

  • @engee_346
    @engee_346 4 года назад +62

    The sleepless hours that I spent trying understand the nomenclature and the functions that he just made clear in 11 minutes... if you had an advanced professional class that cost money, I would pay for it.

  • @nikolahuang1919
    @nikolahuang1919 7 лет назад +235

    This series is the best Python series I've ever watched. Your explanation is so clear and you just teach the right amount of useful knowledge we need.

  • @takuz7879
    @takuz7879 2 года назад +54

    6 years later, and your videos are still helping us students. I'm in highschool and I'm literally studying for my exam through these. When I pass it'll all be because of you. THANK YOU COREY!

    • @eliasvor
      @eliasvor Год назад +3

      did you pass?

    • @takuz7879
      @takuz7879 Год назад +12

      @@eliasvor yeah 🙌

  • @wonderoverload0
    @wonderoverload0 4 года назад +32

    Who needs a Udemy course when you have Corey on RUclips.
    Thanks buddy for making internet useful for us.

  • @peti826
    @peti826 4 года назад +17

    I know there loads of comments appreciating your work already, but man.. . I started learning python about 1,5 months ago and I have never learnt about OOP, not even its concept and the difference related to other types (still dunno them properly), yet I fully understood everything you said in both of your videos so far... Hats off dude.

  • @Bartnick81
    @Bartnick81 7 лет назад +125

    Quality tutorial! You got my patreon backing.

  • @alessanderboy
    @alessanderboy 4 года назад +21

    Hello Corey, I'd like to thank you for all the courses on Python you've made. They're way better than udemy courses and any others. You're doing a great job, captain!

  • @chenlily9444
    @chenlily9444 6 лет назад +17

    As a beginner, I was stuck with learning Python Class and so lucky to find these videos via Google search! Very informative and easy to understand. BTW, the teacher in these videos also has a nice voice ☺

  • @stevenshelby2675
    @stevenshelby2675 4 года назад +10

    This is the type of youtuber whom I would gladly watch 10 straight ads on their video

  • @nadik4531
    @nadik4531 4 года назад +7

    Lol your explanations are better than all my professors. How did I not find this channel years ago smh

  • @ravenjs
    @ravenjs 5 лет назад +16

    I'm so so so glad that I found Corey on RUclips. His teachings are state of the art! Whenever there's something I'm confused about python, he is the first person that comes in mind. I'm so very grateful to have you as a teacher, you rock at it! Keep it up! Can't wait for more!

    • @coreyms
      @coreyms  5 лет назад

      Thanks! Glad to have you

  • @mylo5034
    @mylo5034 6 лет назад +22

    These are really good as i am 12 yrs old and just practising for my class.
    PS. Keep up the good work :D

    • @HaileeMiu
      @HaileeMiu 5 лет назад +9

      What middle school class teaches python?

    • @aliassem859
      @aliassem859 5 лет назад +2

      @@HaileeMiu I am 12 years too, but I just learn it for fun, we dont learn it there

    • @serpent2776
      @serpent2776 4 года назад +1

      @@HaileeMiu Maybe class from outside school?

  • @hectorserrano9314
    @hectorserrano9314 Год назад +9

    Showing the namespace was so clever to help us thoroughly understand it. Thank you so very much!

  • @humayunkabir7925
    @humayunkabir7925 4 года назад +5

    I was thinking i am very good in OOP since got i A+(4.0) in the course both in Theory & Lab, somehow i came to the playlist & saw pretty amazing comments, so i got interest to see what's inside. i was thinking myself a pro in OOP. But the way you teach things here are amazing.

  • @thuggfrogg
    @thuggfrogg 4 года назад +5

    These videos are insanely good... Definitely not for a 100% noob but absolutely amazing for somebody who's hacked around and now needs a technical understanding to get to the next level. Thanks, Corey!

  • @jaxwylde2139
    @jaxwylde2139 4 года назад +9

    Wow! Learned more about classes and class variables, in the last 10 minutes, than on a full day going through online python CBT. Can't wait to watch the rest of this series.

  • @pcb5135
    @pcb5135 Год назад +2

    I dont undertand why not have self.raise_amount as an attribute in the __init__ method? why have it outside

  • @mohamedkhodary7831
    @mohamedkhodary7831 5 лет назад +6

    Finding your channel is like finding a Gold mine Corey , keep up the Gold work ; - )

  • @sharothiiesmat3557
    @sharothiiesmat3557 4 года назад +2

    Hey Corey... You mentioned that setting your class variable i.e Employee_raise_amount to 1.06 will also change the raise_amount of instances. But I ain't getting the same results. I deliberately changed the emp_1.raise_amount to 1.02 and that of emp_2.raise_amount to 1.08 but when I used the class variable Employee.raise_amount equal to 1.06 the raise amounts of emp_1 & emp_2 is not changing. Can you please give me an idea about it. Thank you

    • @rodwynnejones
      @rodwynnejones 4 года назад

      I noticed that too. If you go to 7.20...."it created a raise amount attribute within emp_1".

  • @charlesbovalis6591
    @charlesbovalis6591 5 лет назад +7

    I have NOTHING BUT PRAISES for your style, clarity, and to the point explanation of VERY IMPORTANT concepts .... I cannot thank you enough Corey .. I will gladly contribute to your classes and start filling all the "gaps" of knowledge I need to .. You have a devoted student now :)

  • @alhabib_o
    @alhabib_o Месяц назад +1

    """
    [1] Instance Variables vs. Class Variables ?
    a. Instance (object) variables:
    - Each object (or instance) of a class has its own unique set of instance variables.
    - They are defined inside the '__init__' method. ==> (fname, lname, pay).
    b. Class variables:
    - They are shared across all objects (instances) of the class. ==> (raise_amount, num_of_emps).
    - They are defined directly within the class, just after the class definition.
    [2] Accessing Class Variables.
    a. Access via class name:
    - That makes it clear that the variable belongs to the class itself and not any specific object.
    - In most cases, it is better to access the class variables via class name.
    b. Access via object (instance) name:
    - for example: If you have a 'raise_amount' class variable, and you want to apply that raise only to a specific object (emp_1 for example).
    [3] Modifying Class Variables.
    a. Modify using class name:
    - When you want the change to reflect across ALL objects.
    b. Modify using instance name:
    - When you want the change to reflect on a SPECIFIC object without affecting other objects.
    - The class variable remains unchanged for other instances.
    - Using this method result to creating a NEW INSTANCE VARIABLE for that specific object.
    - for example: If you have a 'raise_amount' class variable, and you want to apply that raise only to a specific object (emp_1 for example).
    [4] Using '__dict__' Attribute.
    - It contains a dictionary of all the instance variables that belong to that object.
    - This is useful to see what attributes are specific to each instance.
    """

  • @noamanrasul
    @noamanrasul 5 лет назад +5

    Oh My God. I was struggling with OOP concepts. Corey made it so simple. Corey keep on doing what you doing my good friend. Thank you.

  • @abdelrhmanahmed1378
    @abdelrhmanahmed1378 4 года назад +1

    why when we declare the var in global scope it will not throw an error
    -------------------------------------------------
    raise_amount =1.04
    class employee:
    raise_amount =1.04
    def __init__(self ,first,last,pay):
    self.first=first
    self.last=last
    self.pay=pay
    def display(self):
    print('{} {}'.format(self.first,self.last))
    def raise_apply(self):
    self.pay=int(self.pay*raise_amount)
    emp1=Employee('ahmed','ali',3000)
    emp1.raise_apply() ==> will use the raise_amount from the global scope and will not raise an error

  • @abbyaaguilar
    @abbyaaguilar 7 лет назад +8

    Dude!!! Such a good explanation. I have a final on Monday and did not understand anything because my teacher thinks he's teaching us by providing us labs with errors and making us figure out how to make it run... How are we supposed to solve it if we don't know WTF
    Thank you!

    • @coreyms
      @coreyms  7 лет назад +2

      Glad you found it helpful!

  • @hasanaslan2688
    @hasanaslan2688 4 года назад +2

    Everything you explained is clear and logical. Thank you

  • @ylhameresov9492
    @ylhameresov9492 8 лет назад +74

    Whenever i see "__something__" like this i get mad. I really really really don't know what this things are it makes learn difficult python for me. Trying to avoid it but this "words" are everywhere. "self" is literally become most annoying word in dictionary for me!

    • @coreyms
      @coreyms  8 лет назад +66

      Hey there. I'm actually doing my next OOP Python class on exactly that topic. Hopefully I will have it released soon.
      This video has been released. It is the 5th video in the series and is about the special dunder methods. You can find it here:
      ruclips.net/video/3ohzBxoFHAY/видео.html

    • @CharleswoodSpudzyofficial
      @CharleswoodSpudzyofficial 7 лет назад +33

      self literally means itself being passes into the methods. It's like walking into a room and saying self walked into the room... self just means exactly what it says. This confused me so much at first because I was over complicating things in my head.

    • @liesdamnlies3372
      @liesdamnlies3372 7 лет назад +6

      Class "methods" in Python are really just functions in their own (class) namespace, hence the requirement that we pass the instance to the function.
      Plus, you could call self whatever you want. self is just by convention. Fun times.

    • @deepdive1338
      @deepdive1338 7 лет назад +2

      ylham eresov u can replace self with anything u want. the thing is self and cls are famous terms so it's easier to stick with them as they don't over complicate ur code

    • @iashishhere
      @iashishhere 6 лет назад +30

      Wow, you edited your comment after making that video that shows your sincerity. That makes you different form others. Thanks man.

  • @harshinivbhat7817
    @harshinivbhat7817 Год назад +2

    These are the best videos ever . I struggled to make sense of these concepts before . Now its all so damn logical and intresrting. A Million tonnes of gratitude to u !

  • @mrchatterjee_
    @mrchatterjee_ 5 лет назад +8

    After working in the industry for 5 years, learned this concept today, just because of the way you made it. I am moving towards into a more coding technology and your videos are gold! Amazing!

    • @shiggigigi
      @shiggigigi 3 года назад +1

      Really? 5 years of tech support scams, and yet you don't know any basics of OOP. Now that's some top tier career dreams

  • @hamdiakkob7925
    @hamdiakkob7925 27 дней назад +1

    Amazing!! So far I'm understanding this giant leap with some ease. 8 years later and you're still helping people out. Thank you man, I felt hopeless really and it was like I hit a wall, but you explain it very smoothly. I did some practice along with your videos and had AI to help me with the vocabulary a little bit, but so far so good. I had to rewind the video every now and then cause you talk too fast lol. English is not my first language so it's my fault. But overall AMAZING man, you got a sub!

  • @elmastermaestr
    @elmastermaestr 8 лет назад +31

    Tank you for covering all of this. I'm truly becoming better in Python because of this

  • @zzjill
    @zzjill 2 года назад +1

    I started to learn python from dataquest and it is very confusing when it comes to the OOP from the dataquest lesson. Wish I have discovered your channel earlier! Thank you!
    I ran in parallel in Jupyter notebook when I learned from this video @2.45 and had TypeError: can't multiply sequence by non-int of type 'float' when use self.pay = int(self.pay * 1.04). It works when I amend it to self.pay = int(self.pay) * 1.04. Would you know why works for you but not in Jupyter?

  • @willylukwago6051
    @willylukwago6051 6 лет назад +4

    I don't know why you don't have more subscribers by now, or maybe there aren't many coders out there. But I was afraid of starting learning Python until I stumbled onto this Chanel. Now I can code as a charm.

  • @sobhanhemati8810
    @sobhanhemati8810 4 года назад +2

    Hi Corey,
    Thanks for your awesome videos.

  • @Soljarag5
    @Soljarag5 5 лет назад +5

    hands down the best OOP tutorial series... I've been using python for 2 years, but have been intimidated by Classes.... this has helped a ton!!!!!

  • @יעלליפשיץ-ס6ש
    @יעלליפשיץ-ס6ש 4 года назад +2

    I love the way you explain everything... Hopefully ,y comment will help your channel! Thank you for sharing your knowledge

  • @joshzakutni5592
    @joshzakutni5592 4 года назад +3

    So in another way of speaking, just to wrap my head around this, object variables such as email and name have unique attributes to whatever is being defined ...birthdays, names, heights, weights, eye color, etc. But a class variable is uniform and essentially(in most cases) would apply to everyone (or collective groups) equally. So this would be something such as total company number of vacation days per year, raise schedule, sick days, or anything else a company sets as a uniform characteristic for X?

  • @bitk3625
    @bitk3625 2 года назад +2

    Thank you for creating this beautiful tutorial.

  • @rsmrostov
    @rsmrostov 6 лет назад +8

    I read a ton of explanation for class attributes and instance attributes, but you explain it so clearly. Great job!

  • @mahdinouira3261
    @mahdinouira3261 Год назад +1

    im apparently using python2
    it shows me this error
    emp_1 = Employee('john', 'Smith')
    TypeError: this constructor takes no arguments

  • @colinsmith5972
    @colinsmith5972 7 лет назад +22

    Corey your explanation of "Class" is just that...... CLASS. Perfect explanation!!! Total Respect.

  • @othernamen
    @othernamen Год назад +1

    Great video. Question: After creating emp_1.raise_amount = 1.05, this means this employee will always have raise amount of 5%. But if this was a once of raise for example on 2022, but in 2023 same employee should have the same raise amount as the rest of employees. Thus how to delete that instance variable and to have value of a global class Employee.raise_amount variable instead for that instance emp_1.raise_amount variable?

  • @taofeekajibade
    @taofeekajibade 2 года назад +3

    So, 5 years ago, this amazing video was made and I'm just seeing it in 2022!
    What a classic teaching it is!
    Thank you for the supremely brilliant delivery 👍

  • @sanjuktamukherjee8881
    @sanjuktamukherjee8881 4 года назад +2

    Thanks for this tutorial .Very helpful.

  • @unknown_f2794
    @unknown_f2794 5 лет назад +4

    I get more explanations from your videos than what I have got from all of my courses, great work!!!!!!

  • @cairink2110
    @cairink2110 6 лет назад +6

    your videos are much better compared to many online courses and free too

  • @splendorman7922
    @splendorman7922 2 года назад +1

    Dude I miss your videos. Best python videos on youtube. I hope you come back and start uploading more valuable videos.

  • @SagnikDuttaegor92
    @SagnikDuttaegor92 4 года назад +4

    Who gives dislikes for gems like these??? For now I only have love and respect for you Corey, Patreon to follow soon :)

  • @ananthalakshmi7375
    @ananthalakshmi7375 9 месяцев назад +1

    Thanks, Corey! It's so informative and an amazing explanation. 👍

  • @anamariabalaban
    @anamariabalaban 2 года назад +4

    It's great that there are people with pedagogical grace, but it's really wonderful when they share their knowledge with beginners. Please don't stop what you're doing ❤

  • @s_a_i_i2416
    @s_a_i_i2416 3 года назад +1

    !!! i did this code but i get 'None' as a output for emp_1.apply_raise
    someone please explain

  • @kppspetshort
    @kppspetshort 6 лет назад +4

    Your explanation is very good, unfortunately i'm not the one in native of English. I tried to watch the video many many time until i got it. Thnaks

  • @mosama22
    @mosama22 2 года назад +1

    Thank you for the beautiful video, but quick question please:
    How can you comment or uncomment more than one line in python at the same time please?

  • @madmowgli1055
    @madmowgli1055 5 лет назад +3

    Absolutely freaking awesome. Hands down, you're providing me an A+ headstart for my bachelor course in economy informatics. Huge thumbs up for spreading absolutely logic and understandable explanations. You're amazing. Thanks.

  • @pranshupriyam632
    @pranshupriyam632 Год назад +2

    Man, you are a gem. Keep making these amazing videos.!!! ❤

  • @juderadford5645
    @juderadford5645 4 года назад +4

    I've been using Sololearn, but this is more straightforward and easy to understand. Thanks!

    • @kwiatriot6190
      @kwiatriot6190 4 года назад

      I am using Sololearn as well and Corey is way better at the OPP stuff!

  • @sametmutevelli
    @sametmutevelli 4 года назад +1

    This is my second video from your channel and you got a new sub to yourself, Sir. Thank you!

  • @martinkaspar5095
    @martinkaspar5095 5 лет назад +2

    hello dear Corey
    overwhelming tutorial - very helpful and in all things Python among of the very best ressources on the whole net.
    One question though can you put togehter the most important infos into a cheatsheet - a Summarizing Cheat Sheet to download: that would be fantastic.
    Above all: dear Corey - you did a fantastic job explaining these concepts of Python programming! I am learning to code and your introduction helps me to fully grasp the ideas.
    dear Corey - keep up the great work - it rocks - and is generally much much better than every paid course on the net.
    best regards martin

  • @kartikbansal3107
    @kartikbansal3107 4 года назад +2

    Your explanations are very good for beginner very insightful
    And one special thing I don't see in other channel videos are that you point out where you will probably make mistakes in future.
    Thanks

  • @IonBeamXXIV
    @IonBeamXXIV 5 лет назад +4

    Thank you so much for this series, these videos are fantastic, I feel like every possible pitfall or misunderstanding one could have you articulately and expertly explain.

  • @Knob126
    @Knob126 4 года назад +1

    คือถ้าใช้ self เนี่ยสมมติ ตั้งไว้ 1.04 เเล้วจะเปลี่ยนหรือเเก้เฉพาะรายบุคคล เป็น1.05ก็เขียนเเค่ em1=1.05 ไม่ต้องมาเขียน def ใหม่

    • @Knob126
      @Knob126 4 года назад

      ที่ไม่เพิ่มในinitก็เพราะ raise amount is not necessary to form in Employee:

  • @vaclavvlcek4527
    @vaclavvlcek4527 5 лет назад +3

    Hi, I need to say your videos are really clear, comprehensive, enough detailed but not boring and too long on the other hand. I just sent you some small donate right now as appreciation. I wish I discovered your channel sooner. Thank you for all your effort!

  • @davidmiricho385
    @davidmiricho385 4 года назад +2

    The best Python tutorials I have come across. Your explanation is just awesome. Keep up the good work.

  • @Finn-jp6pn
    @Finn-jp6pn 5 лет назад +13

    You, sentdex, Traversy Media are the teachers we all need in Uni but don't have. The day I get a job, I'll definitely support you. Thank you for sharing your knowledge.

  • @wisdomTalkswithme
    @wisdomTalkswithme Год назад +1

    method = function
    instance = object
    an object is simply a representative of the class

  • @carljason4299
    @carljason4299 4 года назад +3

    On the 2nd of Feb 2020 ,this video had a 99.64% like - dislike ratio. That's insane. It stands as a testimony to the insanely great work Corey's been doing. Thank you!

  • @neharikaverma1791
    @neharikaverma1791 4 года назад +1

    Your videos are so great but I want to know how to create class for adding two complex number?

  • @billumandal
    @billumandal 8 лет назад +5

    I looked long and hard for differences between instance and class variables, could only find here clearly.

  • @praveen-bt1cw
    @praveen-bt1cw 3 года назад +1

    man u explain dope man
    sub=Infinite
    for i in range(Infinite):
    sub +=infinite
    print(sub*infinite)

  • @aditimore3967
    @aditimore3967 5 лет назад +4

    You might have no idea how helpful this was to us.

  • @juliusarceo3800
    @juliusarceo3800 5 лет назад +1

    "10" , "10", "10"..........slam dunk session by the MJ #23 of Python tutorials. Thanks Corey! Curious as to how long you've been a developer to get to this level?

    • @coreyms
      @coreyms  5 лет назад

      I've been a programmer for over 10 years but I've been doing mainly Python for about 5-6 years now.

  • @VishalMishra-hz4fy
    @VishalMishra-hz4fy 5 лет назад +3

    This is the most logical approach to class and objects, i am really glad i found you Sir! Thankyou for such a beautiful explanation. You solved every doubt!

  • @hewadaragai5270
    @hewadaragai5270 4 года назад +1

    Hi Corey great video you made OOP simple to understand thanks

  • @jeangtr
    @jeangtr 5 лет назад +2

    You, my friend. You are a life saver. Keep up the excellent work! Lives being changed because of you :D

  • @nomoreospf
    @nomoreospf Год назад +2

    Best Python OOP lessons for beginners!

  • @thenode_
    @thenode_ 4 года назад +3

    Corey, to repeat the sentiment here, you really helped drive home what Object Oriented Programming almost instantly. You should have your own Coursera courses.

  • @JuanLopez-pr4dt
    @JuanLopez-pr4dt 5 лет назад +2

    I have paused your video like a million times, but not because you lack the ability to properly explain this, but because your content is so material rich, I have to understand every word. Thank you for these videos!

  • @starplatinumrqm
    @starplatinumrqm Год назад +4

    can't express how nice and easy to understand these videos are

  • @kimkimchai6962
    @kimkimchai6962 Год назад +1

    HI,corey. where can i find some homeworks after I finish this vedio?

  • @Tazumm
    @Tazumm 5 лет назад +3

    I've seen several sites, books, and videos that all used the Employee class as an example for OOP, however this is the only one that actually made sense and helped me understand the concepts. Thanks!

  • @hanohbeizer5368
    @hanohbeizer5368 5 лет назад +1

    Is there any kind of destructor in python?
    There should be -1 employee each time an instance is discarded.

    • @varunkumar_vk
      @varunkumar_vk 5 лет назад

      That's a good observation and yes, there's a destructor method named "__del__"

  • @Abbekej
    @Abbekej 5 лет назад +4

    You are next level, man. Respect!

  • @Mnerd7368
    @Mnerd7368 2 года назад +1

    Your videos are more much effective for me to learn computer programming for my personal gain.

  • @datasciencehelp2030
    @datasciencehelp2030 5 лет назад +3

    1 hour of my Grad class summed up in 11 minutes. Thank you!

  • @falconspy1668
    @falconspy1668 4 года назад +2

    The best python OOP tutorial on RUclips. Thank you sir

  • @gavravdhongadi9824
    @gavravdhongadi9824 5 лет назад +5

    You are literally giving me hope, appreciate it

  • @ddpwe5269
    @ddpwe5269 Год назад +1

    I can see them asking at interviews whether or not you've used the 'tutorials provided by Corey Schafer on RUclips'. You are a natural teacher my friend! Gratz again on the 1mil! Should definitely be well over that! If you don't get your next plaque, make sure to contact YT, apparently they 'forget' sometimes =P

  • @vuyokazimatomela6776
    @vuyokazimatomela6776 6 лет назад +2

    This is the best Video ever to explain classes, i have been very lost for a month trying to get this concept and you explained it in less than an hour thank you soo much. I am going to nail my computer science paper tomorrow

  • @shailavijay1
    @shailavijay1 4 года назад +1

    Really ur explanation is awesome, it help me to understand in betterway.

  • @matfen7978
    @matfen7978 5 лет назад +3

    Everything is so well placed and informative, thank you!

  • @JuniorTechies-wz1yg
    @JuniorTechies-wz1yg Месяц назад +1

    im 12 and im a professional developer in python😂

  • @rafaelgalvan4087
    @rafaelgalvan4087 5 лет назад +3

    Every video is so clear thanks bro!

  • @rayeemomayeer
    @rayeemomayeer 4 года назад +2

    corey`s video
    best of the best.

  • @aaronmackley3472
    @aaronmackley3472 5 лет назад +3

    I've been watching several python training videos. Corey explains things more simply and more completely than anything I have watched so far. Good work.

    • @coreyms
      @coreyms  5 лет назад

      Thanks! Glad it helped!