Trouble with for loop


I am attempting to get this to loop 10 times and print "try again" for each loop that's 10 or below, then on the 11th loop it will print "you lose!" but I cant get it to loop more than once. It is only printing one "try again". Any advice?

chance = [0]
for x in chances:
    if x == 11:
        print "you lose!"
        print "try again"
        chance[0] += 1


This line does not update so there is only one iteration.


Okay thank you. I wasn't using the for loop right.. derp

i just did this:

loop = [1,2,3,4,5,6,7,8,9,10]
for x in loop:
chance = 0
if chance <= 10:
print "try again"
chance += 1
print "you lose!"


Does this look right to you?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.