Jun-29-2022, 04:27 PM
(This post was last modified: Jun-29-2022, 06:46 PM by deanhystad.)
This always prints "HIT" because the expression
"501" or "502" in node
always returns "501". Remember that "a or b" returns a if a is true-ey, else it returns b. In your expression a = "501" and b = ("502" in node). "501" is not an empty string, so it is true-ey.if "501" or ("502" in node): print("HIT")