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


Groups > comp.lang.python > #79046

Re: while loop - multiple condition

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.052
X-Spam-Evidence '*H*': 0.90; '*S*': 0.00; 'subject:while': 0.09; 'cc:addr:python-list': 0.11; 'wrote:': 0.18; 'email addr:gmail.com&gt;': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'pass': 0.26; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; '13,': 0.31; 'probably': 0.32; 'received:google.com': 0.35; 'skip:u 10': 0.60; 'account': 0.65; 'to:addr:gmail.com': 0.65
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:to :cc:content-type; bh=qvyX3WibObo3368u/biBdgeCLS+5xTyRIkj6PTs6jCs=; b=kzqMgJ+atxXle+bL1jcZO7uhAztlXaZTUDN4a5nzfSf0C96DV7nKs2TchnSKZACznl J4N4Hi3OTzrfTyJjNje5N/wFkcNMhnEBPANLqjndiVJspAPMvpU3/YqDscgjFmiAreJD +cZkxn3fWVtu8VSg4sli+NCvdFcrPOudw4f/gbDN4r5cv764ujA8q1q+1DUtH81mctkI dMc5oT5psTlIuGAWTdGSnl4vsvPOzZS3lijLc1CzB6hLZLTT6/1NNsJodEYVbqJP57DQ W7Ro/lAFbxDNx+6tt++o8pV89kM0UL+R5chN+kSEVU6laLVZuJo8IraUY4Ga99NKEksQ 9CbQ==
MIME-Version 1.0
X-Received by 10.42.84.198 with SMTP id n6mr2611879icl.73.1413202209461; Mon, 13 Oct 2014 05:10:09 -0700 (PDT)
In-Reply-To <CAPTjJmrQ4utEQa_2EUFAWLY4R8knodkq6WK09YD3asUMvmUyiQ@mail.gmail.com>
References <loom.20141012T190458-947@post.gmane.org> <m1g2lt$8jj$1@ger.gmane.org> <CAPTjJmrQ4utEQa_2EUFAWLY4R8knodkq6WK09YD3asUMvmUyiQ@mail.gmail.com>
Date Mon, 13 Oct 2014 07:10:09 -0500
Subject Re: while loop - multiple condition
From Skip Montanaro <skip.montanaro@gmail.com>
To Chris Angelico <rosuav@gmail.com>
Content-Type multipart/alternative; boundary=20cf301cc40ab0ef6205054cc764
Cc "python-list@python.org" <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.14820.1413202212.18130.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1413202212 news.xs4all.nl 2921 [2001:888:2000:d::a6]:37726
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 4480
X-Received-Body-CRC 960459150
Xref csiph.com comp.lang.python:79046

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Oct 13, 2014 at 6:59 AM, Chris Angelico <rosuav@gmail.com> wrote:

> while input('Do you like python?') not in ('yes', 'y'): pass


Unfortunately, you probably have to account for people who SHOUT:

    while input('Do you like python?').lower() not in ('yes', 'y'): pass

<wink>

Skip

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


Thread

Re: while loop - multiple condition Skip Montanaro <skip.montanaro@gmail.com> - 2014-10-13 07:10 -0500

csiph-web