結果 : how to write loop function in python