solved problem 4 in python with one liner. I love list comprehensions