Warm up
1) What happens when
>>> x = 1
is executed? The name “x” is assigned the value 1.
![digraph first {
rankdir=LR;
one [label = "1", style=dotted, shape=polygon];
x [label="x", shape=circle];
x -> one;
}](../../_images/graphviz-741990c3156276fdfbbc70f29c7a740485e4f668.png)
2) Let’s take a look at
>>> x = 1
>>> y = x
>>> print(y)
1
The name “y” is assigned the value of the name “x”.
![digraph first {
rankdir=LR;
one [label = "1", style=dotted, shape=polygon];
x [label="x", shape=circle];
y [label="y", shape=circle];
x -> one [weight=100];
y -> one;
}](../../_images/graphviz-4f9f2afb4aef8880902373146553400a57dc0977.png)
Nothing special so far, just terminology.
Lessons
Fundamental facts behind values and names in Python:
Names cannot be assigned to another name.
Assignment never copies data.