Adding Homework 1 Solution.
Cleaned up looping using list comprehension