list and set
list
set
列表去重
a = [1,2,3,3] list = list(set(a))
集合的运算
a = {1,2,3,3} b = {3,4,5} #交集 {3} a.intersection(b) #并集 {1, 2, 3, 4, 5} a.union(b)
Last updated 22 days ago
Was this helpful?