| 1 | initial version |
Can you tell us which error you got (I did not get one for a long time, then i stopped the loop) ?
Moreover, in the first pass through the loop (x = 1, p = 2), c get the value False, and it will never become True again, because it is not reset in the loop. So, your code will not print anything !
Also, instead of writing:
if c==True:
you can simply write:
if c:
because c is a boolean, which has value True or False.
Also, you can remove:
else:
pass
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.