How can I change a location of multiple objects with a loop?

This did exactly what I wanted, thank you!