python
[python] 집합 Sets
Нуеоп
2011. 11. 2. 19:00
S1 = set( L1 )
S2 = set( L2 )
맴버쉽 테스트
item in S1
차집합
S1 - S2
합집합
S1 | S2
교집합
S1 & S2
elements in S1 or S2 but not both
S1 ^ S2
S2 = set( L2 )
맴버쉽 테스트
item in S1
차집합
S1 - S2
합집합
S1 | S2
교집합
S1 & S2
elements in S1 or S2 but not both
S1 ^ S2