結果 : how to stop a while loop when a condition is met python