Python solution of Problem 9.