check if index exist in list python