Re-execution of for loop when exception occured from current position in Python
<p>I want to do something like shown below for my project.</p>
<h1>whenever any exception will occur I want to start the for loop from current position of 'i'</h1>
<p>for eg:
if exception occured at i=3 then my for statement should again start from i=3 till end</p>
<p>Example</p>
<pre><code>for i in range(5):
    try:
        # some code
    except Exception as e:
        restart_for_loop_from_current i
</code></pre>
<p>Thanks in advance</p>