Problem 6 in C.

Long time no solution.
Problem 6 in Python.

Might as well port it across.
Whitespace formatting.

Linting found whitespace errors.
Version support.

Make it work in Python 2 and Python 3.