That code is not even valid, because
eval
only accepts a string; so if you would want to make it work, you should put quotes around your expression. Aside from that, if your expression is a hard-coded one like this, you don't need eval.
About your expression, actually it evaluates to this:
("PRES" == ("PRES" + "PRES") == "PRES") == 1
("PRES" == "PRESPRES" == "PRES") == 1
False == 1
False
That's what it does.
How to fix it? Use use an
and
instead of a
+
. But don't use
+
, because even if you would use parentheses to make sure it would be
("PRES" == "PRES") + ("PRES" == "PRES")
then it would be 2.
So, to make it true, your expression should look like this:
"PRES" == "PRES" and "PRES" == "PRES"
==1
is not necessary; because it would still be True if the above expression is also True.