jeudi 29 janvier 2015

Can't find infinite loop in this while loop in Python

The code below produces an infinite loop that I can't quite place. Would you please help me find the infinite loop?



while count <= 25:
randnum = random.randint(1,25)
int(randnum)
rindex = randnum - 1
if randnum not in seats:
if seats[rindex - 1] and seats[rindex + 1] != 0:
seats[rindex] = randnum
count += 1
else:
count += 0
else:
count += 0




Aucun commentaire:

Enregistrer un commentaire