solution for loops exercise 3