Turing Interview Question

A puzzle to solve using python.