Amazon interview question

for my OA I needed for loops in python