I am new to Python and I need to convert a for loop to a while loop and I am not sure how to do it. This is what I am working with:
for
while
like this:
def scrollList(myList): negativeIndices = [] i = 0 while i < len(myList): if myList[i] < 0: negativeIndices.append(i) i += 1 return negativeIndices