variableName=[\"display\",\"screen\",\"sound\"\"audio\"]
fileName=[\"PPP\", \"Abc\"]
P1=\"PPP\"
d=\"display\"
s=\"screen\"
ss=\"sound\"
a=\"audio\"
d=P1
loop=True
def CH
Using
if (variableName) in Up.lower():
....tests for the existence of a tuple
(variableName)
in a string Up.lower()
.
Since variableName
is actually a list of strings, depending on what you are trying to achieve, you may well want to use one of the following instead:
if any(s in Up.lower() for s in variableName):
if all(s in Up.lower() for s in variableName):
any()
option will return True
if any
of the strings s
in variableName
are in Up.lower()
. all
option will return True
if all
of the strings s
in variableName
are in Up.lower()
.