class Foo:
X = 10
f = Foo()
Foo.X = 30
p = Foo()
print(Foo.X, f.X, p.X)
Options:
Explanation
Correct answer is : D
"X" is a class attribute and shared by all the instances.
Here Foo.X = 30 , we are changing this class attribute using class name.
So the same value will changed for all the instances
Comment here: