Having trouble on solving the following tasks

I think i need to be careful the next time i use a for loop. Thanks for the great help guys. I'll be sure to let you know what i've done for my next task :).