Skip to content

Instantly share code, notes, and snippets.

@Wizmann
Created April 4, 2013 03:28
Show Gist options
  • Select an option

  • Save Wizmann/5307464 to your computer and use it in GitHub Desktop.

Select an option

Save Wizmann/5307464 to your computer and use it in GitHub Desktop.
无聊乱跪
#coding=utf-8
if __name__ == '__main__':
with open("input.txt") as data:
a, b = map(set,zip(*[line.split() for line in data]))
print 'a,b两集合里都包含的元素'
for item in a.union(b):
print item
print '-'*20
print 'a有而b没有的'
for item in a.difference(b):
print item
print '-'*20
print 'b有而a没有的'
for item in b.difference(a):
print item
print '-'*20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment