What is the output of the following code ?
class Foo: X = 10 def hello(self): self.X = 20 f = Foo() print(Foo.X, f.X)
"X" is a class attribute.Class attribute will be shared by all instances"f" is an instance here. So has access to "X"
Comment here: