Python solution to problem 9
Python solution to problem 10.