Why do we still need “break” to exit?


I am confused about increment the value of count has caused “False” already. Why do we still need “break” to exit ?


Why doesn’t while True run forever?

please post your code and exercise url



count = 0

while True:
print count
count += 1
if count >= 10:


If you wouldn’t use break, you have an infinity loop.

while True can never become false, so we need to break the loop


Got it… Thank you!