Assigning one variable’s value to another “links” the variables, so changing one changes the other
In addition to establishing that values that were once held in a variable are not retrievable, it is also important to help students understand that a program is evaluated one line a time. This means that what has appeared before it is irrelevant to how a future line will be executed. The program is, in essence, “memoryless”. Video Length: 1:01
Python Example: The code below shows how the state changes after an assignment of one variable to another.
a = 8 b = 10 a = b # substitute 10 for b and assign to a b = 4 # a remains 10, while b is changed to 4