What you need here is a while
loop. It will be much easier for you to control the iterations inside the loop. You can structure it like this:
i = 0
while i < len(list):
if condition:
var = something from dictionary
else:
i++