New to python, I cannot get the following simple compounded if statement to work
if A == B & C >= D & C <= E:
each of the sub statements works on there own but I can't seem to combine them together in one command.
New to python, I cannot get the following simple compounded if statement to work
if A == B & C >= D & C <= E:
each of the sub statements works on there own but I can't seem to combine them together in one command.
&
is a binary bitwise operator, not the boolean operator and
you are looking for.
Do this:
if A == B and C >= D and C <= E: