Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: while loop - multiple condition Date: Mon, 13 Oct 2014 15:09:19 +0300 Organization: A noiseless patient Spider Lines: 13 Message-ID: <87d29wmas0.fsf@elektro.pacujo.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="14100"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mYgNn2vlOsC6W10wqWI7Y" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:DpFAuMmGy08OnpOYEPJo3yaeSvo= sha1:AV7z4f+6xBYmMoUzn3j3aGLU1NM= Xref: csiph.com comp.lang.python:79045 Chris Angelico : > Or, even simpler: Use an active condition. > > while input('Do you like python?') not in ('yes', 'y'): pass Instead of the traditional "pull" technology, you could take advantage of the state-of-the-art "push" approach: print("You must love python -- everybody does!") Marko