Nokia interview question

Python related question that were not very tough