Problem 1 Solution - Python