結果 : how to stop a nested loop in python