Tracing Assignment and Type

An assignment works out the right side first, then stores that result in the name on the left. What the name holds afterwards is a copy of the value the…

An assignment copies a value, it does not link two names
An assignment works out the right side first, then stores that result in the name on the left. What the name holds afterwards is a copy of the value the right side had at that moment. If the thing it was copied from changes later, the copy does not follow along.
That one rule is behind everything in this set.
Swapping two variables
Two names hold two values, and you want them to trade places. The obvious two lines do not do it.
The third line overwrites first, so 41 is gone before the fourth line ever runs. The fourth line then copies back whatever first is holding NOW, which is 17. Nothing anywhere in the program still remembers 41, so no later line can bring it back.
The short way
Python also lets you write a swap on a single line, like this:
first, second = second, first
The whole right side is worked out BEFORE either name is touched, so both original values are already in hand when the two assignments happen, and neither one can be lost. That one line does the same job as the three lines above. Be able to read both.
A single slash always hands back a float
A single slash is true division. Its result is a float every single time, even when the division comes out even and there is nothing left over. A double slash keeps only the whole-number part of the answer, and when both sides are ints it hands back an int.
The two are not mirror images of each other, and the difference is worth pinning down. A single slash gives a float no matter what it was handed. A double slash gives an int only when nothing it was handed was a float already; hand it a float and the result is a float too, even though the fractional part has been thrown away.
ExpressionPrintsType
72 / 89.0float
72 // 89int
Comparing values of different types
The + operator refuses to mix a string with a number, and stops the program when you ask it to. The == operator refuses nothing at all. It compares whatever it is handed and answers True or False, and a string is never equal to a number no matter how alike the characters look.