Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4814

Re: if statement multiple or

From Christian Heimes <lists@cheimes.de>
Subject Re: if statement multiple or
Date 2011-05-06 13:00 +0200
References <BANLkTinSHanse0mgUJVsUZ_6nHh5zLjbUw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1236.1304679638.9059.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar


Thread

Re: if statement multiple or Christian Heimes <lists@cheimes.de> - 2011-05-06 13:00 +0200
  Re: if statement multiple or scattered <tooscattered@gmail.com> - 2011-05-06 05:09 -0700
    Re: if statement multiple or Christian Heimes <lists@cheimes.de> - 2011-05-06 14:25 +0200
      Re: if statement multiple or scattered <tooscattered@gmail.com> - 2011-05-06 06:17 -0700
        Re: if statement multiple or Tim Golden <mail@timgolden.me.uk> - 2011-05-06 14:31 +0100

csiph-web