<p>Given the following code (that doesn't work):</p>
<pre><code>while True:
    # Snip: print out current state
    while True:
        ok = get_input(&quot;Is this ok? (y/n)&quot;)
        if ok.lower() == &quot;y&quot;: break 2 # This doesn't work :(
        if ok.lower() == &quot;n&quot;: break

    # Do more processing with menus and stuff
</code></pre>
<p>Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?</p>

First, ordinary logic is helpful.
If, for some reason, the terminating conditions can't be worked out, exceptions are a fall-back plan.
```
```
class GetOutOfLoop( Exception ):
    pass

try:
    done= False
    while not done:
        isok= False
        while not (done or isok):
            ok = get_input("Is this ok? (y/n)")
            if ok in ("y", "Y") or ok in ("n", "N") : 
                done= True # probably better
                raise GetOutOfLoop
        # other stuff
except GetOutOfLoop:
    pass
```
```
For this specific example, an exception may not be necessary.
On other other hand, we often have "Y", "N" and "Q" options in character-mode applications.  For the "Q" option, we want an immediate exit.  That's more exceptional.