Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #49158
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <davea@davea.name> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.049 |
| X-Spam-Evidence | '*H*': 0.90; '*S*': 0.00; 'else:': 0.03; 'subject:Question': 0.07; '(other': 0.16; 'clauses': 0.16; 'received:74.208.4.195': 0.16; 'two.': 0.16; 'wrote:': 0.18; 'print': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; '"please': 0.31; 'username': 0.31; 'skip:u 20': 0.35; 'test': 0.35; 'hi,': 0.36; 'two': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'new': 0.61; 'more': 0.64; 'different': 0.65; 'taking': 0.65; 'received:74.208': 0.68 |
| Date | Tue, 25 Jun 2013 09:40:41 -0400 |
| From | Dave Angel <davea@davea.name> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Loop Question |
| References | <2149a85e-e41b-46bf-a12d-7565789748a9@googlegroups.com> <afc4753e-d7b0-46b1-80d4-0e2fe8440871@googlegroups.com> <9e7940d2e7647db397ab662d33b06128@posteo.de> |
| In-Reply-To | <9e7940d2e7647db397ab662d33b06128@posteo.de> |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Provags-ID | V02:K0:FJFyK1WEd3ox4E/jqBxS6LDttUlmZ+FzcC3bRUaZwcn 75dthA0svNstuTgEiG2FW3TCm2WlceXXB7MZmmNzNwV7c4exSo Bde9qT1x1JjbhiwE52JiyngINnN+pfAEkRSVLipd2kh+VoNwtd A09QAcIYgNzSgO1FnBKWO4eo1Qkwfmgx9geGRVVIo4IWrVI9ua puo1xgT8R/Vb43YR1CBJLjUaiTXe9dAvWZ3+Wb0IFARbNBdvAF 6YdlS7oPcJw5NLWpNdHgIYHpxrSYejJnIlLjtmeN3LxWDXOIq6 RCm1nqFCtX+4OlrBTtR0AlcdldaoveKa+KVWQoy3a8RbdDHbiX w5NPTNMVNmOAjkdUB3GQ= |
| 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 | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3827.1372167656.3114.python-list@python.org> (permalink) |
| Lines | 36 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1372167656 news.xs4all.nl 15908 [2001:888:2000:d::a6]:60244 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:49158 |
Show key headers only | View raw
On 06/24/2013 08:20 AM, Lutz Horn wrote:
> Hi,
>
> Am 24.06.2013 14:12 schrieb christhecomic@gmail.com:
>> username=raw_input("Please enter your username: ")
>> password=raw_input("Please enter your password: ")
>> if username == "john doe" and password == "fopwpo":
>> print "Login Successful"
>> else:
>> print "Please try again"
>
> while not username or not password or username != "john doe" or password
> != "fopwpo":
> print "Please try again"
> username=raw_input("Please enter your username: ")
> password=raw_input("Please enter your password: ")
>
> print "Login Successful"
>
>
That requires you to have four raw_input() calls instead of two. And
what purpose does adding the two new clauses to the while test serve?
How is:
while not username or not password or username != "john doe" or password
!= "fopwpo":
different from:
while username != "john doe" or password != "fopwpo":
(other than taking more time and space, and being harder to read) ?
--
DaveA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Loop Question christhecomic@gmail.com - 2013-06-23 16:18 -0700
Re: Loop Question rurpy@yahoo.com - 2013-06-23 16:49 -0700
Re: Loop Question christhecomic@gmail.com - 2013-06-23 20:24 -0700
Re: Loop Question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-24 00:23 +0000
Re: Loop Question christhecomic@gmail.com - 2013-06-24 05:12 -0700
Re: Loop Question rusi <rustompmody@gmail.com> - 2013-06-24 07:03 -0700
Re: Loop Question Lutz Horn <lutz.horn@posteo.de> - 2013-06-24 14:20 +0200
Re: Loop Question Dave Angel <davea@davea.name> - 2013-06-25 09:40 -0400
Re: Loop Question christhecomic@gmail.com - 2013-06-24 11:23 -0700
Re: Loop Question John Gordon <gordon@panix.com> - 2013-06-24 18:42 +0000
Re: Loop Question Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-06-24 20:53 +0200
Re: Loop Question John Gordon <gordon@panix.com> - 2013-06-24 19:00 +0000
Re: Loop Question Dave Angel <davea@davea.name> - 2013-06-24 15:23 -0400
csiph-web