Syntax of 'in' : searching a list for a string
paschen at mavd.de
Mon Mar 22 11:26:41 CET 2004
> I want to check whether the string 'Remove' is present in a list
> 'supportList', but if I do
> if ('Remove') in supportList:
> if 'Remove' in supportList:
> I get the error message
> 'in ' requires character as left operand.
for i in supportList:
if i == 'Remove':
I am sure there is a shorter way, but this will work.
More information about the Python-list