What is the need of count?


#1
while count < 3: num = random.randint(1, 6) print num if num == 5: print "Sorry, you lose!" break count += 1 else: print "You win!" What is the need ofcount += 1in the code? THANK YOU

#2

It is the upper limit for our algorithm. Once count is reached, the program stops.


#3

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