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


Groups > comp.lang.python > #73223

Re: About python while statement and pop()

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.021
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:()': 0.09; 'subject:while': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '13,': 0.31; '>>>>': 0.31; 'subject:About': 0.31; 'fri,': 0.33; 'received:google.com': 0.35; 'false': 0.36; 'yield': 0.36; 'done': 0.36; 'ensure': 0.60; 'cheating': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=pdyF1larSsfuOXBRafjzXoL1mqjKf3Xh4g8WM9NFTvY=; b=nRq5YBBS3WjCtw9hd0Zs4dhB7w2NePK6P5EARZWdN5TcxIy9+qwu+5kl7FqGhTzQtP 8atwwnQT8X6RInGv54NHRaZsz7rCpeUyYxI5CiD2BJxHzR2UZOdqATuOTmMBRom2XpGK XDfshByACtV1LjYdurHhJb7Uttc1nsyOYlWP2Ea8FU0bBuk6TuMngtHlxxZBYemyWC6D cnI2HihDam0TBZ1hQ52ZqsANRKoOei4M8IRace/KxB9EMIk7jSMr8KiXKz1vkzm3elAz HHYyNTKljNRuscECPgJ5KQlY0f0eR82O1P+JQfkwrLjncFhf7e1kViNjlHSkyhAqtBky ZBHQ==
MIME-Version 1.0
X-Received by 10.58.77.9 with SMTP id o9mr225716vew.69.1402592225854; Thu, 12 Jun 2014 09:57:05 -0700 (PDT)
In-Reply-To <lnclm5$oe4$1@speranza.aioe.org>
References <8d6207ab-b883-4940-8e53-75546a91d4dd@googlegroups.com> <lnclm5$oe4$1@speranza.aioe.org>
Date Fri, 13 Jun 2014 02:57:05 +1000
Subject Re: About python while statement and pop()
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.11035.1402592234.18130.python-list@python.org> (permalink)
Lines 15
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1402592234 news.xs4all.nl 2948 [2001:888:2000:d::a6]:52837
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:73223

Show key headers only | View raw


On Fri, Jun 13, 2014 at 2:49 AM, Mark H Harris <harrismh777@gmail.com> wrote:
> Consider this generator variation:
>
>>>> def poplist(L):
>         done = False
>         while done==False:
>
>                 yield L[::-1][:1:]
>                 L = L[::-1][1::][::-1]
>                 if len(L)==0: done=True

Why not just "while L"? Or are you deliberately trying to ensure that
cheating will be detectable?

ChrisA

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


Thread

About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-11 20:12 -0700
  Re:About python while statement and pop() Dave Angel <davea@davea.name> - 2014-06-11 22:34 -0500
  Re: About python while statement and pop() Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2014-06-12 05:40 +0200
  Re: About python while statement and pop() Chris Angelico <rosuav@gmail.com> - 2014-06-12 13:58 +1000
    Re: About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-11 21:56 -0700
      Re: About python while statement and pop() Chris Angelico <rosuav@gmail.com> - 2014-06-12 15:08 +1000
      Re: About python while statement and pop() Steven D'Aprano <steve@pearwood.info> - 2014-06-12 05:43 +0000
        Re: About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-11 23:06 -0700
        Re: About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-12 00:13 -0700
        Re: About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-12 02:51 -0700
  Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 11:41 -0500
  Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 11:49 -0500
    Re: About python while statement and pop() Marko Rauhamaa <marko@pacujo.net> - 2014-06-12 19:55 +0300
      Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 12:07 -0500
    Re: About python while statement and pop() Chris Angelico <rosuav@gmail.com> - 2014-06-13 02:57 +1000
      Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 12:10 -0500
      Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 12:16 -0500
        Re: About python while statement and pop() wxjmfauth@gmail.com - 2014-06-12 11:37 -0700

csiph-web