Variables – Student Misconceptions and Challenges

Below are examples of common student misconceptions specifically related to variables in Python. However, many of these misconceptions are conceptual and so are common in other programming languages as well.

Misconception: Variables used in programs work like variables in math

Misconception: When assigning the value of one variable to another, students may invert the order. Is it A=B or B=A? (with video)

Misconception: Assignment A = B + 1 changes the value of B by 1, as well as changing A (with video)

Misconception: Assigning one variable’s value to another “links” the variables, so changing one changes the other (with video)

Misconception: Assignment statements like A = B + 1 are stored as a formula rather than as a value. (with video)

Misconception: The left hand side of assignment statement does not always need to be variable

Misconception: Students think computers have intelligence and so know what value should be associated with a variable name (with video)

Misconception: We can mix types on expression. For example, why not write A = 5 + “Hero”? (with video)