1 oldlist=[1,2,4,2,4,5,6,5,7,8,9,8] 2 newlist=[] 3 for i in oldlist: 4 if i not in newlist: 5 newlist.append(i) 6 print(newlist)
面试题编程题02-python 删除列表中重复项
猜你喜欢
转载自www.cnblogs.com/feihujiushiwo/p/10896590.html
今日推荐
周排行