Python Programming Tutorial | Class or Static Variables in Python | GeeksforGeeks

preview_player
Показать описание

This video is contributed by Afzal Ansari

Please Like, Comment and Share the Video among your friends.

Install our Android App:

If you wish, translate into local language and help us reach millions of other geeks:

Follow us on Facebook:

And Twitter:

Also, Subscribe if you haven't already! :)
Рекомендации по теме
Комментарии
Автор

Is class method and static method are same like class variable and static variable are same .

neerajgupta
Автор

class student:
count = 0 # static variable
def __init__(self):
student.count += 1 # Adding 1 to count number of object created

student1 =student()
student2 =student()
print(student1.count)
print(student2.count)

# NOTE : don't use self.[VARIABLE] as it will be contained only in it object
# and will not me shared in all object of a class
# How to making static variable:
# 1)make it outside function within class
# 2)apply changes using CLASS.STATICVARIABLE syntax to apply changes statically
# like in 4th line of my program

abubakar.khawaja
Автор

Abe jab padana nahi ata to q itna paka raha hai, reab bhi nahi karna ata barabar se srf class class kar rha hai

woodfeather..
Автор

your speak in telugu views is increasee

pamisettyvenkatesh