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
- Linux
- 기타 연주
- error
- pandas
- windows forms
- Docker
- pip
- Numpy
- C#
- OpenCV
- pytorch
- Selenium
- 컨테이너
- SSH
- mysql
- ubuntu
- JSON
- 핑거스타일
- C
- C++
- label
- Python
- nvidia-smi
- 채보
- VS Code
- Visual Studio
- 오류
- 프로그래머스
- paramiko
- YOLO
Archives
- Today
- Total
기계는 거짓말하지 않는다
Python Index Error 본문
TypeError: 'int' object is not subscriptable
인덱스로 지정할 수 없는 경우(단일 값)
# TypeError: 'int' object is not subscriptable
intValue = 10
print(intValue[3])
intArray = [1, 2, 3]
print(intArray[0][1])
TypeError: list indices must be integers or slices, not str
TypeError: string indices must be integers
숫자 형식 인덱스에 Key 형식으로 받은 경우
# TypeError: list indices must be integers or slices, not str
intArray = [1, 2, 3]
print(intArray["A"])
# TypeError: string indices must be integers
strValue = "AAAA"
print(strValue["A"])
'Python' 카테고리의 다른 글
Python Numpy transpose (0) | 2021.08.04 |
---|---|
Python Class 정렬, 정렬 기준 (0) | 2021.08.03 |
Python ValueError: invalid literal for int() with base 10 (0) | 2021.08.02 |
Python OpenCV 웹캠 실시간 읽기 (0) | 2021.07.31 |
Python OpenCV Error Sequence item with index 0 has a wrong type (0) | 2021.07.31 |
Comments