"""
列表去重
list = [1,2,3,2,4,23,24,2,42,4,23,5,35,6,45,35,2,645,73]
"""
List = [1, 2, 3, 2, 4, 23, 24, 2, 42, 4, 23, 5, 35, 6, 45, 35, 2, 645, 73]
# 空列表来存储第一次出现的数字
new_list = []
for i in List:
if i not in new_list:
new_list.append(i)
new_list.sort()
print(new_list)
|
|