The immutable object in python
问题 I see a article about the immutable object. It says when: variable = immutable As assign the immutable to a variable. for example a = b # b is a immutable It says in this case a refers to a copy of b , not reference to b . If b is mutable , the a wiil be a reference to b so: a = 10 b = a a =20 print (b) #b still is 10 but in this case: a = 10 b = 10 a is b # return True print id(10) print id(a) print id(b) # id(a) == id(b) == id(10) if a is the copy of 10 , and b is also the copy of 10 , why