Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.linkpendium.com!news.linkpendium.com!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Loop Question Date: Mon, 24 Jun 2013 18:42:43 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 25 Message-ID: References: <2149a85e-e41b-46bf-a12d-7565789748a9@googlegroups.com> NNTP-Posting-Host: panix1.panix.com X-Trace: reader2.panix.com 1372099363 13743 166.84.1.1 (24 Jun 2013 18:42:43 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 24 Jun 2013 18:42:43 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:49062 In christhecomic@gmail.com writes: > On Sunday, June 23, 2013 6:18:35 PM UTC-5, christ...@gmail.com wrote: > > How do I bring users back to beginning of user/password question once they > > > > fail it? thx > Can't seem to get this to cooperate...where does the while statement belong? 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" -- 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"