li = [1,2,3,4] # [1,3,4] # 索引值是奇数的删除 for i in range(4): if i % 2 == 1: li.pop(i) # 会报错 print(li) 面试题: li = [1,2,3,4,5] #[1,3,4,5] # 索引值是奇数的删除 for i in range(4): if i % 2 == 1: li.pop(i) # 结果不对 print(li) li = [1,2,3,4,5] for i in range(len(li)-1,-1,-1…