結果 : how to loop through a 2d matrix in python