Persistent failure of 'break' statement ( novice )

pdlemper at earthlink.net pdlemper at earthlink.net
Sat Jun 13 20:20:17 EDT 2009


Thanks Mark & Rhodri.  Neither works.

I'm using Notepad2 as editor.  Don't use the tab. Each space
counted with spacebar & recounted.  Rewrote the block from
scratch as new script and eliminated the print line in the loop.
Now no error message, but it will go on forever despite repeatedly
entering 0.  Have to get out with ctrl-c .     

while True :
    num = int(input())
    if num == 0 :
        break

print('done')

           Frusting: I'm missing something fundamental. Dave WB3DWE



More information about the Python-list mailing list