i want to check if 3 keywords are in line, the keywords being
( ,) and module
I tried
if "(" or ")" or "module" in line:
That didn't work. How do I check it?
i want to check if 3 keywords are in line, the keywords being
( ,) and module
I tried
if "(" or ")" or "module" in line:
That didn't work. How do I check it?
You need to change it to following :
if "(" in line or ")" in line or "module" in line:
Actually your command is equal to if True or True or "module" in line:
In the context of Boolean operations, and also when expressions are used by control flow statements, the following values are interpreted as false:
False, None, numeric zero of all types, and empty strings and containers (including strings, tuples, lists, dictionaries, sets and frozensets). All other values are interpreted as true.