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


Groups > comp.lang.python > #49065

Re: Loop Question

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: Loop Question
Date 2013-06-24 19:00 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <kqa503$369$1@reader2.panix.com> (permalink)
References <2149a85e-e41b-46bf-a12d-7565789748a9@googlegroups.com> <e41ce3a3-c8cb-4cfc-ba86-462f40f322fc@googlegroups.com> <kqa3v3$ddf$1@reader2.panix.com> <mailman.3754.1372100014.3114.python-list@python.org>

Show all headers | View raw


In <mailman.3754.1372100014.3114.python-list@python.org> =?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= <kwpolska@gmail.com> writes:

> > while True:
> >     username = raw_input("Please enter your username: ")
> >     password = raw_input("Please enter your password: ")
> >
> >     if username == "john doe" and password == "fopwpo":
> >         print "Login Successful"
> >         break
> >
> >     else:
> >         print "Please try again"

> You didn't test the code, did you?  Because the code you posted is
> right.

It's right, therefore I did not test it?  I don't understand.

If the code has a bug, please point it out.

> And note that the getpass module is what you should use for that second
> thing in real life, for the security of your users.

I'm sure this is just an exercise for the OP to understand loops.  Security
would be counter-productive.

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

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


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