J.P. Morgan interview question

Writing loops in Python or other languages