Given the following code (that doesn\'t work):
while True: #snip: print out current state while True: ok = get_input(\"Is this ok? (y/n)\")
Similar like the one before, but more compact. (Booleans are just numbers)
breaker = False #our mighty loop exiter! while True: while True: ok = get_input("Is this ok? (y/n)") breaker+= (ok.lower() == "y") break if breaker: # the interesting part! break # <--- !