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


Groups > comp.lang.python > #54356

Re: Having both if() and for() statements in one liner

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joshua.landau.ws@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.104
X-Spam-Level *
X-Spam-Evidence '*H*': 0.84; '*S*': 0.05; 'subject:both': 0.07; 'cc:addr:python-list': 0.11; '0):': 0.16; 'range(0,': 0.16; 'to:addr:pearwood.info': 0.16; "to:name:steven d'aprano": 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "d'aprano": 0.31; 'piece': 0.31; 'sep': 0.31; 'steven': 0.31; 'received:google.com': 0.35; 'subject:one': 0.36; 'thank': 0.38; 'dave': 0.60; 'truly': 0.60; 'times': 0.62; 'treasure': 0.84; 'angel': 0.91; 'forever.': 0.91; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=MMG/iYIRgOl5c5UycYKGonbacMU5n4S/VrhRmQHZVDM=; b=wD8gN3jV4yjyvC+U9HeXnIfFfwWMQ+SCRkly8XzDG9C2AZ279iFbQR9yMj1fSwdXP2 pcJmTckNunBLrTIxWM8UCb0FQDnympXvgxzMXsLpM4Ngeqgu59E/OP70XW7Hgy+x38SC HcEHH71yvPQb5KjLpwvHkB7Sh/ViZl2DrBZSL+2g6Yymlk2FaGbkm2vjYTgTfYvdLdmX u+R1yYavlZ8mB/UjgtgiY/xWyZL1c8n59Iw84/0g/Q2sWDVpfXKELSEo2jI/Ioc7Jima 8KjnZJ3/c/iu2+tAFyECpuoCW3vZ4g90STmb1F8cyPzw7nzeHSkvqL/A1VKGnauS8c+a IsUQ==
X-Received by 10.112.159.166 with SMTP id xd6mr33369674lbb.22.1379483783180; Tue, 17 Sep 2013 22:56:23 -0700 (PDT)
MIME-Version 1.0
Sender joshua.landau.ws@gmail.com
In-Reply-To <52390bb0$0$29869$c3e8da3$5496439d@news.astraweb.com>
References <l19gdf$psh$1@dont-email.me> <roy-7F8454.09003417092013@news.panix.com> <l19kvs$m4q$1@dont-email.me> <mailman.88.1379444117.18130.python-list@python.org> <52390bb0$0$29869$c3e8da3$5496439d@news.astraweb.com>
From Joshua Landau <joshua@landau.ws>
Date Wed, 18 Sep 2013 06:55:42 +0100
X-Google-Sender-Auth Gn1a7mdvcnvK-hkHQDn9yRV6iQ4
Subject Re: Having both if() and for() statements in one liner
To "Steven D'Aprano" <steve@pearwood.info>
Content-Type text/plain; charset=UTF-8
Cc python-list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.102.1379483791.18130.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1379483791 news.xs4all.nl 15974 [2001:888:2000:d::a6]:48465
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:54356

Show key headers only | View raw


On 18 September 2013 03:10, Steven D'Aprano <steve@pearwood.info> wrote:
> On Tue, 17 Sep 2013 18:54:51 +0000, Dave Angel wrote:
>
>> for times in range(0, 5 if person=="George" else 0):
>
>
> Oh that is evil. Truly evil.
>
> Thank you, I will treasure that piece of code forever.

range(person == "simon" and 5)

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


Thread

Having both if() and for() statements in one liner Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-09-17 15:02 +0300
  Re: Having both if() and for() statements in one liner Robert Kern <robert.kern@gmail.com> - 2013-09-17 13:52 +0100
  Re: Having both if() and for() statements in one liner Roy Smith <roy@panix.com> - 2013-09-17 09:00 -0400
    Re: Having both if() and for() statements in one liner Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-09-17 16:21 +0300
      Re: Having both if() and for() statements in one liner Heiko Wundram <modelnine@modelnine.org> - 2013-09-17 15:46 +0200
      Re: Having both if() and for() statements in one liner Tim Chase <python.list@tim.thechases.com> - 2013-09-17 09:17 -0500
      Re: Having both if() and for() statements in one liner Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-17 10:32 -0400
      Re: Having both if() and for() statements in one liner Dave Angel <davea@davea.name> - 2013-09-17 18:54 +0000
        Re: Having both if() and for() statements in one liner Steven D'Aprano <steve@pearwood.info> - 2013-09-18 02:10 +0000
          Re: Having both if() and for() statements in one liner Joshua Landau <joshua@landau.ws> - 2013-09-18 06:55 +0100
          Re: Having both if() and for() statements in one liner Chris Angelico <rosuav@gmail.com> - 2013-09-18 17:00 +1000
    Re: Having both if() and for() statements in one liner Chris Angelico <rosuav@gmail.com> - 2013-09-18 01:04 +1000
    Re: Having both if() and for() statements in one liner Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-17 11:15 -0400

csiph-web