Add problem 2 solution done in python.