Python: try again some block if any condition exists : <p>I need to realize next algorithm:
if I get <code>False</code> more that three times, do <code>continue</code>, if this number less that <code>3</code>, try again and again.</p>

<pre><code>list = [1, 2, 3, 4, 5, 6, 6, 8, 8, 64, 4, 5, 6]
result = False
for elem in list:
    trying = 0
    while not result:
        print(elem)
        try:
            result = elem % 2 == 0
        except:
            trying += 1
            print(trying)
            if trying == 3:
                continue
            else:
                pass
</code></pre>

<p>it doesn't go to block <code>except</code>.
Can anybody explain, what should I change to get desirable?</p>
