Cox Automotive interview question

Manipulating a for loop in Python