标签: python python-3.x python-2.7
list = ["abc","cde","efg","ghi","ijk","klm"] for x in list: print(x) list.remove(x) print(list)
输出:
abc efg ijk ['cde', 'ghi', 'klm']
为什么此代码未删除列表中的所有项目? 有人可以解释一下