結果 : check if index is out of range python