読者です 読者をやめる 読者になる 読者になる

set()楽しい

a = [1, 2, 3, 4, 5]
b = [1, 2, 6, 7, 8]
print set(a)
print set(b)
print set(a+b)
print set(a+b) - set(a)
print set(a+b) - set(b)
print [i for i in (set(a+b) - set(a))] + [i for i in (set(a+b) - set(b))]
print set([i for i in (set(a+b) - set(a))] + [i for i in (set(a+b) - set(b))])
print set(a+b) - set([i for i in (set(a+b) - set(a))] + [i for i in (set(a+b) - set(b))])
set([1, 2, 3, 4, 5])
set([8, 1, 2, 6, 7])
set([1, 2, 3, 4, 5, 6, 7, 8])
set([8, 6, 7])
set([3, 4, 5])
[8, 6, 7, 3, 4, 5]
set([3, 4, 5, 6, 7, 8])
set([1, 2])