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


Groups > comp.lang.python > #99946

Re: filter a list of strings

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From <c.buhtz@posteo.jp>
Newsgroups comp.lang.python
Subject Re: filter a list of strings
Date Thu, 3 Dec 2015 10:27:19 +0100
Lines 20
Message-ID <mailman.165.1449134847.14615.python-list@python.org> (permalink)
References <mailman.155.1449122975.14615.python-list@python.org> <lf51tb459f2.fsf@ling.helsinki.fi>
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de dzzOMHxtaQvkPeS4qPm+JQvoU0EZVXgA47lZogQ1XUWQ==
Return-Path <c.buhtz@posteo.jp>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.064
X-Spam-Evidence '*H*': 0.88; '*S*': 0.00; 'that?': 0.05; 'happen.': 0.09; 'received:172.16.0': 0.09; 'python': 0.10; 'received:io': 0.16; 'received:psf.io': 0.16; 'suggestion.': 0.16; 'wrote:': 0.16; 'header:In-Reply-To:1': 0.24; 'subject:list': 0.26; 'lot.': 0.29; 'combination': 0.33; 'know.': 0.34; 'list': 0.34; 'item': 0.35; 'but': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'charset:us-ascii': 0.37; 'front': 0.38; 'thank': 0.38; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'from:no real name:2**0': 0.60; 'your': 0.60; 'header:Message-Id:1': 0.61; 'saw': 0.77; 'received:185': 0.91; 'imagine': 0.96
In-Reply-To <lf51tb459f2.fsf@ling.helsinki.fi>
X-Mailer Claws Mail 3.9.3 (GTK+ 2.24.23; i686-pc-linux-gnu)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:99946

Show key headers only | View raw


Thank you for your suggestion. This will help a lot.

On 2015-12-03 08:32 Jussi Piitulainen <harvesting@is.invalid> wrote:
> list = [ item for item in list
>          if ( 'Banana' not in item and
>               'Car' not in item ) ]

I often saw constructions like this
  x for x in y if ...
But I don't understand that combination of the Python keywords (for,
in, if) I allready know. It is to complex to imagine what there really
happen.

I understand this
  for x in y:
    if ...

But what is about the 'x' in front of all that?
-- 
GnuPGP-Key ID 0751A8EC

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

filter a list of strings <c.buhtz@posteo.jp> - 2015-12-03 02:15 +0100
  Re: filter a list of strings Jussi Piitulainen <harvesting@is.invalid> - 2015-12-03 08:32 +0200
    Re: filter a list of strings <c.buhtz@posteo.jp> - 2015-12-03 10:27 +0100
      Re: filter a list of strings Jussi Piitulainen <harvesting@is.invalid> - 2015-12-03 13:53 +0200
      Re: filter a list of strings Peter Pearson <pkpearson@nowhere.invalid> - 2015-12-05 19:42 +0000
    Re: filter a list of strings Chris Angelico <rosuav@gmail.com> - 2015-12-03 20:40 +1100
    Re: filter a list of strings Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2015-12-03 10:46 +0100
    Re: filter a list of strings Laura Creighton <lac@openend.se> - 2015-12-03 10:53 +0100
    Re: filter a list of strings jmp <jeanmichel@sequans.com> - 2015-12-03 11:03 +0100
    Re: filter a list of strings Peter Otten <__peter__@web.de> - 2015-12-03 11:13 +0100
    Re: filter a list of strings Denis McMahon <denismfmcmahon@gmail.com> - 2015-12-03 14:16 +0000
      Re: filter a list of strings Jussi Piitulainen <harvesting@is.invalid> - 2015-12-03 17:02 +0200
  Re: filter a list of strings Grobu <snailcoder@retrosite.invalid> - 2015-12-03 13:17 +0100

csiph-web