if statement multiple or

James Mills prologic at shortcircuit.net.au
Fri May 6 07:36:22 EDT 2011


On Fri, May 6, 2011 at 8:47 PM, Lutfi Oduncuoglu
<lutfioduncuoglu at gmail.com> wrote:
> 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

You will need to (naively) do this:

if "a" not in line or "b" not in line or "c" not in line:
    print line

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"



More information about the Python-list mailing list