# How do I teach “math equality” vs. “CS assignment” vs. “CS equality logic operator”?

Consider the following three uses of equality:

• In mathematics, the statement $x = x^2$
• In Python, the statement x = x**2
• In Python, the expression, x == x**2

The math statement is a constraining assertion restricting x to the set $\{0, 1\}$; the Python assignment always evalutes the right side and assigns to the left side; the Python expression always returns True or False.

When and how should the differences be pointed out to students? Are there examples producing unexpected results that are especially effective in causing students to abandon the idea that these three meanings of equality are equivalent?