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

1. 튜플(Tuple) 리스트와 비슷하지만 리스트는 대괄호로 자료를 감싸고, 튜플은 소괄호로 감쌈 요소의 수정, 삭제 불가능 튜플이 사용되는 이유 - 파이썬은 변수 선언이 아니므로 재사용시 오류를 잡을 수 없음 이런일로 데이터가 바뀌는일이 없어야 되는경우 튜플 사용 In [1]: tu1 = () print(tu1) tu1[0] = 100 # TypeError: 'tuple' object does not support item assignment () --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in 2 print(tu1) 3 ----> ..
파이썬 기초
2023. 3. 7. 11:08