title: Converting a for loop to a while loop
body: <p>I am new to Python and I need to convert a <code>for</code> loop to a <code>while</code> loop and I am not sure how to do it. This is what I am working with:</p>
  
  <pre class="lang-py prettyprint-override"><code>def scrollList(myList):
        negativeIndices = []
        for i in range(0,len(myList)):
              if myList[i] &lt; 0:
                   negativeIndices.append(i)
        return negativeIndices
  </code></pre>