+ 1
How can we initalize static variable in python?
2 Respostas
+ 7
class Animal:
species = 100
def method1(self, c):
pass
def method2(self, d):
pass
# Any variable declared inside a class but not within any of its methods is a class (or static) variable.
>>> Animal.count
100
+ 1
Can you give us an example of what you want to do?