What is the difference between an instance attribute/property and a class attribute/property? When do I use one and when do I use another in Python?
That is, if we have:
class Foo:
a = 5
def print_a(self):
print(self.a)
Y:
class Foo:
def __init__(self):
self.a = 5
def print_a(self):
print(self.a)
What differences are there with respect to the attribute a
?