To add to what Richard says, "=" is a Python assignment operator:
a = b
Means "assign the value of
b
to
a
The equality comparison operator is "==":
a == b
Means "compare
a
and
b
, return true only if they are the same".
"and" is a logical operator:
a and b
Menas compare
a
and
b
and return true only if both are true.
Python Comparison Operators[
^]
Python Logical Operators[
^]
Quite what you meant to do with that code, I'm really not sure...