Added problem three solution in python.