This programming language misconception is related to
the meaning of Python's =
operator.
You see that the value of a
in the second printout is 2.0.
Thus the a = v / 2
assigned the result of evaluating v / 2
to a
;
it did not assign the expression v / 2
to a
.
If you would like to learn more about this misconception, including its possible origins, symptoms students who hold this misconception might exhibit, the related programming language concepts, links to the corresponding parts of the Python language specification, and related misconceptions, check out VariablesHoldExpressions in the progmiscon.org misconception inventory.
This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.
VariablesHoldExpressions
PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI
Privacy Policy • Platform Version 1e22f67 (Sat, 19 Jul 2025 12:40:41 GMT)