250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- count()
- MySqlDB
- View
- shuffle()
- HTML
- locals()
- discard()
- __getitem__
- __len__
- Database
- 파이썬
- mro()
- decode()
- inplace()
- CSS
- glob
- zipfile
- items()
- 오버라이딩
- remove()
- __annotations__
- fnmatch
- randrange()
- __sub__
- MySQL
- choice()
- shutil
- JS
- node.js
- fileinput
Archives
- Today
- Total
목록set (1)
흰둥이는 코드를 짤 때 짖어 (왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!)

1. 세트(set) 수학의 집합과 비슷한 형태로 순서가 없어서 어떤 값이 먼저 나올지 알 수 없고, 중복되는 데이터를 허용하지 않음 딕셔너리처럼 중괄호를 사용해서 선언하지만, key는 존재하지 않고 value만 존재 1-1. set만들기 In [1]: s1 = {} print(s1) print(type(s1)) {} In [2]: s1 = {1, 3, 5, 7} print(s1) print(type(s1)) {1, 3, 5, 7} In [3]: li1 = [1, 3, 5, 7] s2 = set(li1) print(type(s2)) In [4]: s3 = {1, 3, 5, 3, 7, 9, 1} print(s3) {1, 3, 5, 7, 9} In [5]: li2 = [1, 3, 5, 3, 7, 9, 1] p..
파이썬 기초
2023. 3. 8. 15:04