Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92509
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Marko Rauhamaa <marko@pacujo.net> |
| Newsgroups | comp.lang.python |
| Subject | Re: Error in or |
| Date | Fri, 12 Jun 2015 12:55:08 +0300 |
| Organization | A noiseless patient Spider |
| Lines | 17 |
| Message-ID | <87k2v91car.fsf@elektro.pacujo.net> (permalink) |
| References | <3bf5dd52-c698-4392-be2b-5c0aeefc3cd3@googlegroups.com> <557aa956$0$11125$c3e8da3@news.astraweb.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="23997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18z9yaOvjWaGfiqNe5xKku2" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
| Cancel-Lock | sha1:a0oJ4vl0M6Vbu5mua3z2EURrnvo= sha1:vKF/jwNjsgyIYaksm8671Rvw0sk= |
| Xref | csiph.com comp.lang.python:92509 |
Show key headers only | View raw
Steven D'Aprano <steve+comp.lang.python@pearwood.info>:
> This is better written as:
>
> if any(substr in inp1 for substr in
> ['AND', 'OR', 'NOT', '>', '&', 'MAYBE', '(', '*', ' " ']):
> print 'FINE'
Or, equivalently:
for substr in ['AND', 'OR', 'NOT', '>', '&', 'MAYBE', '(', '*', ' " ']:
if substr in inp1:
print('FINE')
break
Marko
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Error in or subhabrata.banerji@gmail.com - 2015-06-11 08:40 -0700
Re: Error in or Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-11 09:49 -0600
Re: Error in or subhabrata.banerji@gmail.com - 2015-06-11 09:39 -0700
Re: Error in or Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-11 10:47 -0600
Re: Error in or subhabrata.banerji@gmail.com - 2015-06-11 10:21 -0700
Re: Error in or Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-11 18:54 +0100
Re: Error in or Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-12 09:41 +0000
Re: Error in or Marko Rauhamaa <marko@pacujo.net> - 2015-06-12 12:55 +0300
csiph-web