solution to problem 13 in python
update docstring