class MemberCounter:
members = 0
def init(self):
MemberCounter.members += 1
# m1 = MemberCounter()
# m1.init()
# MemberCounter.members
-> 1
# m2 = MemberCounter()
# m2.init()
# MemberCounter.members
-> 2
# m1.members
-> 2
#m2.members
-> 2
# m1.members = 'Two'
# m1.members
-> 'Two'
# m2.members
-> 2
In the above code how is it that in the upper portion m1 and m2 are sharing the same members variable but after I re-assign m1 to 'Two' and are suddenly two different variables? Also, what is init?