Jul-22-2021, 10:18 AM
I am trying to write some code to return True if either AH, MH or GL are in mStrip. I want to apply a condition to GL (but not AH or MH) so that it is True only if ML is not in mStrip.
Is the code below correct? Is there a better way of writing it? I want to add additional And/Or conditions in the future and I can see it getting confusing very quickly.
Is the code below correct? Is there a better way of writing it? I want to add additional And/Or conditions in the future and I can see it getting confusing very quickly.
if 'AH' in mStrip or 'MH' in mStrip or 'GL' in mStrip and not 'ML' in mStrip: