Added Python solution to Problem 4