if statement multiple or

Christian Heimes lists at cheimes.de
Fri May 6 07:00:24 EDT 2011


Am 06.05.2011 12:47, schrieb Lutfi Oduncuoglu:
> 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
> 
> But it does not work for. What may be the problem

if any(s not in line for s in ('a', 'b', 'c')):
   # do something

Christian




More information about the Python-list mailing list