# class variables = Shared among all instances of a class # Defined outside the constructor # Allow you to share data among all objects created from that class class Student: class_year = 2025 num_students = 0 def __init__(self, name, age): self.name = name self.age = age Student.num_students += 1 student1 = Student("Spongebob", 30) student2 = Student("Patrick", 35) student3 = Student("Squidward", 55) student4 = Student("Sandy", 27) print(f"My graduating class of {Student.class_year} has {Student.num_students} students") print(student1.name) print(student2.name) print(student3.name) print(student4.name)
@JassersChannel6 ай бұрын
what is the use of class variables, like can you give me basic for-dummies example?
@Ronstadtlive7 ай бұрын
How did you know I was struggling with this? Your timing is intuitive and impeccable
@AgGh-c5s7 ай бұрын
Make a video about Django and python
@mahadkhan30147 ай бұрын
BRO what happened?? 76 videos in 2 days???
@bacon54817 ай бұрын
welcome back brotha, hope you been well, thanks for all that you do
@ReighKnight7 ай бұрын
Please continue making this series. It is tremendously valuable. Cannot thank you enough Bro
@3ameralhlal2744 ай бұрын
Thank You You are the best one to teach Python.
@Mocomochii7 ай бұрын
THE GOAT IS BACK 🔥 love u
@DwayneLofton7 ай бұрын
Even though I know classes reasonably well i always find nuggets in your videos. 🎉
@mr.unknown53077 ай бұрын
Please make a tutorial on Nmap in python reply = input("Reply: ").lower() while(reply != "yes"): print("Please Bro!") reply = input("Reply: ").lower() print("Thanks Bro!");
@Pradeep-mh9ui2 ай бұрын
Thanks!
@luisladino61626 ай бұрын
Thanks bro
@TamilCoder.7 ай бұрын
Thank you bro❤
@kedarppopuri27767 ай бұрын
Bro please make django tutorial. It is a Humble request from your loyal follower
@Imoqine7 ай бұрын
Thanks Bro , would you like to start assembly language please , I find it hard. we understand you're explanation the most .
@adamcylee7 ай бұрын
You are very good. Love from SINGAPORE!
@tytusmajewski709224 күн бұрын
fun fact - sponge bob was born in 1986- as states his driving license - so he is 38 now