1. 列表去重
li = [] for item in my_list: if item not in li: li.append(item)
2.集合去重
list(set(my_list))
3.字典去重
dict1 = dict.fromkeys(my_list, '') li = dict1.keys
https://www.cnblogs.com/delav/p/9364244.html
1. 列表去重
li = [] for item in my_list: if item not in li: li.append(item)
2.集合去重
list(set(my_list))
3.字典去重
dict1 = dict.fromkeys(my_list, '') li = dict1.keys
https://www.cnblogs.com/delav/p/9364244.html