nums = [1, 2]
before = id(nums)
# mutating keeps the same object
nums.append(3)
print(id(nums) == before)
n = 10
before = id(n)
# "changing" an int actually rebinds to a new object
n += 1
print(id(n) == before)lists change in place; ints and strings do not