Immutable Int

a = 12

dictionary = {
  "one": a
}
a
12
dictionary
{'one': 12}
a += 9
a
21
dictionary
{'one': 12}

int is immutable, that’s why you can’t see the dictionary value changed

Here you are assigning to key ‘a’ same reference as one.

So now dictionary[‘one’] and a points to the same object 12.

Now when you write: a += 9 it creates a new object 21 and assigns var to this object.