Why continue doesn't work while raising errors
<p>I'm trying to figure out why continue doesn't work when I'm rising errors:</p>

<pre><code>while True:
        a = int(raw_input('Type integer with 9 numbers '))
        if len(str(a)) &lt; 9 or len(str(a)) &gt;9:
                raise NameError('Wrong Number. Try again...')
                continue
        if not istance(a, int):
                raise ValueError("Oops!  That was no valid number.  Try again...")
                continue
        else:
                print a
                break
</code></pre>

<p>Could you point out my mistake(s)?</p>

<p><code>raise</code> will trigger an exception and the program will terminate.</p>

<p>I find a few contradictions in your code: </p>

<blockquote>
  <p>You are converting the user input to an int class, so <code>if isinstance(a, int)</code> is not at all required because <code>a</code> will point to an int class already. If in case, user input could not be converted to "int" then <code>ValueError</code> exception will be raised and program execution would end right there, so not event the first <code>if ...</code> statement will be evaluated.</p>
</blockquote>

<p>I would rewrite the code with little changes:</p>

<pre><code>while True:
    try:
        a = int(raw_input('Type integer with 9 numbers '))
    except ValueError:
        print "Non-numeric chars were entered"
        continue
    if len(str(a)) != 9:
        print "Wrong number"
        continue
    else:
        #do whatever you wanna do
        print 'You entered nine digits...hurray'
        break
</code></pre>

python