Break for while loop


#1

Hi coders,

I have a general question about how break works.

Here’s the code:

count = 0

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

The question:
Does break change True into False? Or is break just something like a blockade for the loop while True stays True?

Thanks in advance!
JK


#2

no, break will simple stop the loop. It changes nothing to the while loop condition


#3

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