Start inner loop from position of the outer
<p>In my example I have two loops. One nested within the other. Is there a way I can start the inner loop from the index of the outer. Here is pseudo code. </p>

<pre><code>arrayOfWords = ["one","two","five"]
arrayOfWords2 = ["one","two","three","four","five"]
tottalWordlist = []
for index, jString in enumerate(arrayOfWords):
    gWord = arrayOfWords[index]
    indexClone = index
    arrayOfWords2Count = range(len(arrayOfWords2)-1)
    for indexClone in arrayOfWords2Count:
        if gWord == arrayOfWords2[indexClone]:
            tottalWordlist.append(gWord)
            break
</code></pre>

<p>You're almost there. You just need to add the starting index to the <code>range</code> object.</p>

<pre><code>arrayOfWords2Count = range(indexClone, len(arrayOfWords2))
for i in arrayOfWords2Count:
    if gWord == arrayOfWords2[i]:
</code></pre>

<p>Also, you don't need to subtract one from the endpoint, as that end is exclusive.</p>

python