Amazon Interview Question

for my OA I needed for loops in python