Exercise: Loops and Functions

Solving the first part of the exercise.