結果 : python how to avoid nested for loops