📌  相关文章
📜  python获取一个列表中缺少的列表元素-TypeScript代码示例

📅  最后修改于: 2022-03-11 14:48:27.340000             🧑  作者: Mango

代码示例1
list1 = ['1.1.1.1/24', '2.2.2.2/24', '3.3.3.3/24', '4.4.4.4/24']
list2 = ['3.3.3.3/24', '4.4.4.4/24', '5.5.5.5/24', '6.6.6.6/24']

set1 = set(list1)
set2 = set(list2)

missing = list(sorted(set1 - set2))
added = list(sorted(set2 - set1))

print('missing:', missing)
print('added:', added)