結果 : how to close a loop in python