I’ve got a while loop of the form:
while temp is True:
do stuff
if the outcome is what I want:
temp = False
I seem to use this construct quite often. So my question is whether there is a way I can initialise temp in the while statement itself, rather than have to precede this with temp = True?
>Solution :
You can use:
while True:
do stuff
if the outcome is what I want:
break