일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- ubuntu
- ngui
- 배열
- sqlite
- Shader
- Unity
- C++
- sql
- autovacuum
- conda
- Eclipse
- pi
- if
- awk
- null
- DROP
- dataframe
- mysql
- postgresql
- 쉘
- pandas
- SSH
- expect
- python
- SVN
- with
- c++11
- boost
- List
- FIND
Archives
- Today
- Total
목록List (2)
その先にあるもの…
[PYTHON] 리스트 합집합, 교집합, 차집합, 대칭차
list1 = ['A', 'B', 'C', 'D'] list2 = ['C', 'D', 'E', 'F'] [1, 2, 3, 4, 5, 6, 7, 8, 9] 합집합 union = list( set(list1) | set(list2) ) print( union ) [1, 2, 3, 4, 5, 6, 7, 8, 9] union = list( set().union(list1, list2) ) print( union ) [1, 2, 3, 4, 5, 6, 7, 8, 9] 교집합 intersection = list( set(list1) & set(list2) ) print( intersection ) [5] intersection = list( set(list1).intersection( list2 ) ) print( ..
프로그래밍/Python
2020. 6. 26. 16:13