Luke Paireepinart wrote: >> if x = 2243: > this will always evaluate to true.
No, it is a syntax error. > x is being assigned the value of 2243. 2243 is being returned by the > assignment. No, assignment is a statement, not an expression; that's why it is a syntax error. > You can observe this in the following situation: > >>> y = x = 2243 > >>> y > 2243 I think this is a special case of assignment. Try y = (x = 2243) and you will see that (x = 2243) is not an expression. Kent _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
