面试题编程题01-python 删除列表中重复项

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)

 

posted @ 2019-05-20 21:28  飞虎就是我  阅读(261)  评论(0)    收藏  举报