list1 = ['a', 'a', 'b', 'c']
# 用set集合对列表去重,是最常用的去重方法
list1_unique = list(set(list1))
print(list1_unique)
# 打印 ['a', 'b', 'c']
Python - 最常用的列表去重方法
猜你喜欢
转载自blog.csdn.net/weixin_39129504/article/details/85842910
今日推荐
周排行