Python OOP Tutorial 2: Class Variables

///Python OOP Tutorial 2: Class Variables

Python OOP Tutorial 2: Class Variables

FavoriteLoadingAdd to favorites

In this Python Object-Oriented Tutorial, we will be learning about class variables. We will see how they differ from instance variables and also some ideas for exactly how we would want to use them. Let’s get started.

Python OOP 1 – Classes and Instances –
Python OOP 2 – Class Variables –
Python OOP 3 – Classmethods and Staticmethods –
Python OOP 4 – Inheritance –
Python OOP 5 – Special (Magic/Dunder) Methods –
Python OOP 6 – Property Decorators –

The code from this video can be found at:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey’s Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:
My Website –
My Second Channel –
Facebook –
Twitter –
Instagram –

#Python

source

By |2019-08-03T21:44:47+00:00August 3rd, 2019|Python Video Tutorials|25 Comments

25 Comments

  1. Simon Timothy August 3, 2019 at 9:44 pm - Reply

    @Corey Schafer

    thanks , thanks , thanks ! u da best !
    I would sell everything I own to be the participant of any class you conduct! thanks sir!

  2. Tariq Shabir Bhatti August 3, 2019 at 9:44 pm - Reply

    creative programming techniques are taught by Corey Schafer..

  3. Farouk Nadjem August 3, 2019 at 9:44 pm - Reply

    if anyone wants to learn python he defintely should see your videos 😉

  4. Daqualynn Cobbs August 3, 2019 at 9:44 pm - Reply

    You should really be a teacher 😅😅

  5. Glaze August 3, 2019 at 9:44 pm - Reply

    Awesome tutorials

  6. Rajesh Raut August 3, 2019 at 9:44 pm - Reply

    Please make videos on
    Polymorphism,abstraction,
    Encapsulation

  7. Kushagra Soni August 3, 2019 at 9:44 pm - Reply

    what happens if we try to update num_of_emps variable through instances? like emp1.num_of_emps

  8. selim atmaca August 3, 2019 at 9:44 pm - Reply

    Corey, you must be the best instructor in this universe. I love watching your videos. Thank you

  9. Mohan Raj Puttaraju August 3, 2019 at 9:44 pm - Reply

    can num_of_emps be both instance variable and class variable?

  10. חן כהן - ואטורי August 3, 2019 at 9:44 pm - Reply

    amazing work, man! 🙂

  11. Fratm August 3, 2019 at 9:44 pm - Reply

    Hi Corey, which IDE are you using in this video to make your code edits?

  12. Amy Sandstrum August 3, 2019 at 9:44 pm - Reply

    Youre so awesome.

  13. Code By DT August 3, 2019 at 9:44 pm - Reply

    Sir Do you have any Data Structure and Algorithm series
    Please share the link

    LOVE YOU SIR

    Fan from INDIA

  14. YA dU August 3, 2019 at 9:44 pm - Reply

    While doing employee.num_of_emps+=1
    How did python knw that emp1 tells it to add 1 to num_of_emps
    And emp2 to add another 1…making it 2..?

  15. Aditi More August 3, 2019 at 9:44 pm - Reply

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

  16. Vaclav Vlcek August 3, 2019 at 9:44 pm - Reply

    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!

  17. Ravi Kumar m August 3, 2019 at 9:44 pm - Reply

    Excellent

  18. AllomerusMusic August 3, 2019 at 9:44 pm - Reply

    Another excellent explanation. Thanks Corey!

  19. Justic H August 3, 2019 at 9:44 pm - Reply

    it is my 3rd time to come back and watch again
    it made aboviusly more clear to me

  20. DAni M August 3, 2019 at 9:44 pm - Reply

    Hi, Corey . I hope you read this in a time 2:45 you didn't write Print for apply_raise method so how did print the result ? Because for instance also you didn't use print . It made me confused . Thank you

  21. rozhan mirzaei August 3, 2019 at 9:44 pm - Reply

    I prefer watching your tutorials than watching Netflix

  22. Ahmad Hazim Ahmad Fuad August 3, 2019 at 9:44 pm - Reply

    How did you comment on the selected line?

  23. Scott klein August 3, 2019 at 9:44 pm - Reply

    As somebody who used C# for years, and is now picking up some python. Thank you for clearing up some of what I saw as weirdness with the way python does things. Its all clear now and simple.

  24. Schimbeschi August 3, 2019 at 9:44 pm - Reply

    hi there, can anyone tell me, is there a way to take a variable that is inside a method within a class and make it global ,the way raise_amount is at 4:31, or any way to get a variable out of a class… please..i need help

  25. TMTGAU August 3, 2019 at 9:44 pm - Reply

    Interesting that print(emp_1.__dict__) prints out in random order

Leave A Comment

*