Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #75274 > unrolled thread
| Started by | Martin S <shieldfire@gmail.com> |
|---|---|
| First post | 2014-07-27 19:53 +0200 |
| Last post | 2014-07-27 19:53 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
complete brain fart, it doesn't loop Martin S <shieldfire@gmail.com> - 2014-07-27 19:53 +0200
| From | Martin S <shieldfire@gmail.com> |
|---|---|
| Date | 2014-07-27 19:53 +0200 |
| Subject | complete brain fart, it doesn't loop |
| Message-ID | <mailman.12360.1406483608.18130.python-list@python.org> |
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 "<p>Long line with games</p>"
counter=counter+1
--
Regards,
Martin S
Back to top | Article view | comp.lang.python
csiph-web