This is because you are working with reference types, and when reassigning lists, you are assigning a reference, not a value. Here’s what’s going in your code:
- Variables are initialized.
- The variable “items” is assigned the value of the variable j.
- The variable “list” reference to the same link as items.
At this step you have:
items [‘value’] = “Bugs Bunny”,
list  = “Bugs Bunny”.
The place where you are having problems is the next iteration:
4. As soon as you assign a new value to the “items” variable, your “list” variable (which points to the same place in memory) will have the same value.
5. You are assigning “items” to the “list” variable one more time.
This way you get duplicate values.
For clarity, you can try adding another print after you assigned a value to the variable “items”, but BEFORE assigning a value to the “list”.
Best regards, Nikita.