Multiple ‘or’ condition in Python [duplicate]

Use not in and a sequence: if fields[9] not in (‘A’, ‘D’, ‘E’, ‘N’, ‘R’): which tests against a tuple, which Python will conveniently and efficiently store as one constant. You could also use a set literal: if fields[9] not in {‘A’, ‘D’, ‘E’, ‘N’, ‘R’}: but only more recent versions of Python (Python 3.2 … Read more

I use OR to form a multiple condition IF ELSE statement on VBA, it’s not working

Using the line below is incorrect: ElseIf (Selection.Value = “hold to console” Or “Hold to console” Or “Allocated 14/12 and ship next day”) Then You need to add Selection.Value = before each condition, see line below: ElseIf Selection.Value = “hold to console” Or Selection.Value = “Hold to console” Or Selection.Value = “Allocated 14/12 and ship … Read more