Created
April 4, 2013 03:28
-
-
Save Wizmann/5307464 to your computer and use it in GitHub Desktop.
无聊乱跪
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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