I am having a small problem implementing a simple and or logic in python. Here is an example
a = 1
b = 0
c = 1
a == b and c
a == b or c
or aren't strictly Boolean operators. They treat operands in a Boolean context, but don't implicitly convert them to Boolean values. If you want a boolean value, do the conversion explicitly.
a == b or bool(c)
Be sure you are using Boolean constants where they are relevant. If
c only ever gets a value of
1, then use
True directly, instead of encoding Boolean values as integers (like in C).