Dailyprogrammer Challenge #111 in Python.