Skip to content

Instantly share code, notes, and snippets.

@stilllisisi
Last active February 18, 2020 03:04
Show Gist options
  • Save stilllisisi/ba6e5e8bf3043c71c3903533f184d13d to your computer and use it in GitHub Desktop.
Save stilllisisi/ba6e5e8bf3043c71c3903533f184d13d to your computer and use it in GitHub Desktop.
【python-列表/字典处理】使用sets计算交集和差集
set1 = {1,2,3,4}
set2 = {3,4,5,6}
set1.intersection(set2)#交集
set1.difference(set2)#差集
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment