if statement multiple or

Albert Hopkins marduk at letterboxes.org
Fri May 6 07:02:30 EDT 2011


On Fri, 2011-05-06 at 13:47 +0300, Lutfi Oduncuoglu wrote:
> Hi,
> 
> I am trying to write a script and I realised that I need to use
> something like
> 
> if ('a' or 'b' or 'c')  not in line:
>    print line
> 

The expression:
    ('a' or 'b' or 'c') 

evaluates to True

    True not in line

Is probably not what you intended.





More information about the Python-list mailing list