結果 : check if index out of range python