Nokia Interview Question

Python related question that were not very tough