[Solved] How to use ‘if statement’ with ‘or’ operator in python [duplicate]


or evaluates two Boolean expressions. In your case, the statement in the bracket is evaluated first and then the in is evaluated. This leads to the if statement being interpreted as false. You do not need to use the brackets. Just do this:

if 'Null' in y or '' in y:

Now there’s a Boolean expression on either side of the or, so it will evaluate properly.

0

solved How to use ‘if statement’ with ‘or’ operator in python [duplicate]