I'm learning about python class. In a toy python script,
class test():
    def __init__(self, a, b):
        self.new = a
        self.old = b
    def another_one(self):
        temp = self.new
        for key in temp.keys():
            temp[key] += 1
    def old_one(self):
        old = self.old
        old += 1
a = {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5}
b = 5
test_pass = test(a, b)
test_pass.another_one(), test_pass.old_one()
a, b
I found that by running the method another_one of instance test_pass, dictionary a will be changed. However, integer b will not be altered by running the method old_one.
Why a dictionary will be changed while an integer will not?
 
     
    