Let's assume that you have the following: class Solution1(object): def some_function(self, a, b): self.ans = 0 def some_other_function(x, y): manipulates self.ans return self.ans class Solution2(object): def some_function(self, a, b): ans = 0 def some_other_function(x, y): manipulates ans return ans the only difference between Solution1 and Solution2 are that one has self.ans and one has ans as variables. Can they differ in values? Continue reading...