Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'elif': 0.05; 'skip:e 50': 0.05; '#if': 0.07; 'snippet': 0.09; 'martin': 0.11; "'':": 0.16; 'loops': 0.16; 'res': 0.16; 'result)': 0.16; 'reset': 0.22; 'to:name:python-list@python.org': 0.22; 'question': 0.24; 'function': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'skip:d 20': 0.34; 'test': 0.35; 'received:google.com': 0.35; 'skip:o 20': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'skip:o 30': 0.61; '10:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=PJIbDJmP34V2m576eQwcLI1U85qGnqoiz/sSc0rJBbQ=; b=IZUDHLxrWXSXb04sR8knuuR3Y2xhD/dxOVskkbOzO0aXtPjuSZkSz7O1yCbNXhRYko 3A7ZoZA9CPXsEpQObqUKf8sPZ2sOAYNoksCq9g4FPfMLuZBFT0v5gNMRvg73YZzSm/rT /d57qDHccZlK24y4v5Z0LPqFXq31t7DTnXrHBBbq4+mP3dVsGIBBseYN71sZyjhqcm8z LnuXcTZ7alrT0yNHozuCNi2aBUKAh7VZqtHq2jdPIFrw8Drv1Thi4tShPkgwh8jQGDXe k/aqd3xZbaKJemgr6KcHmj1PL8YfXEs9RJZC/TB6QNkYyNcPNRCLCy8nH/IzVi0FH0BY 7xkw== MIME-Version: 1.0 X-Received: by 10.236.185.132 with SMTP id u4mr34134775yhm.95.1406483600454; Sun, 27 Jul 2014 10:53:20 -0700 (PDT) Date: Sun, 27 Jul 2014 19:53:20 +0200 Subject: complete brain fart, it doesn't loop From: Martin S To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406483608 news.xs4all.nl 2881 [2001:888:2000:d::a6]:50704 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75274 I have this snippet in my web application. Question is why doesn't the stupid thing loop ten times? It loops exactly 1 time. # Reset counter counter = 0 while counter <= 10: #if test != '': tourn=games[counter][0] round=games[counter][1] date=games[counter][2] opponent=games[counter][3] oppRating=int(games[counter][4]) oppElo=int(games[counter][5]) res=games[counter][6] eloChange=float(Elocalc(myElo,oppElo,modifierK,res)) if myRating > oppRating: HL='H' rdiff=myRating-oppRating else: HL='L' rdiff=oppRating-myRating result=res+HL #Call function if myRating <=2199: rchange=LASKcalc(rdiff, result) else: rchange=LASKcalc(rdiff, result)/2 if res == '1': verbalres='win' elif res== '=': verbalres='draw' else: verbalres='loss' return "

Long line with games

" counter=counter+1 -- Regards, Martin S