Infinite Loops


#1



#2

count = 0

while count < -1: # Add a colon
count += 1
print count
# Increment count

What is wrong with this code? Any help would be appreciated. Thank you.


#3

The end point is negative one, but your count starts at zero, so count will never be less than negative one. You have two options, you can replace -1 with anything above zero, or you can replace

the += with -=


#4

Thanks For The Help - It Worked


#5

Awesome, no problem. :slight_smile:


#6

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