Turing interview question

Python program and time complexity