Added solution to Problem 16 in Python.