Syntax of 'in' : searching a list for a string

Dang Griffith noemail at
Mon Mar 22 13:36:30 CET 2004

On 22 Mar 2004 02:02:51 -0800, robichon at (MarieR) wrote:

>Sorry for my newbie question:
>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.
>Thanks in advance for your help,
What perfect timing--the question right before yours asked which
version of Python added support for that syntax.  You need to be using
2.3 or newer to use the 'in' operator to search for a string in a

More information about the Python-list mailing list