Python how to convert this for loop into a while loop
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/12610623/converting-a-for-loop-to-a-while-loop">Converting a for loop to a while loop</a>  </p>
</blockquote>



<p>I have this for a for loop which I made I was wondering how I would write so it would work with a while loop.</p>

<pre><code>def scrollList(myList):
    negativeIndices=[]
    for i in range(0,len(myList)):
        if myList[i]&lt;0:
            negativeIndices.append(i)
    return negativeIndices
</code></pre>

<p>So far I have this</p>

<pre><code>def scrollList2(myList):
    negativeIndices=[]
    i= 0
    length= len(myList)
    while i != length:
        if myList[i]&lt;0:
            negativeIndices.append(i)
            i=i+1

    return negativeIndices
</code></pre>
