기술(Tech, IT)/파이썬(Python)
[Python] TypeError: 'int' object is not subscriptable
Daniel803
2023. 5. 11. 17:24
TypeError: 'int' object is not subscriptable
: Python에서 List가 아닌 int 변수를 slicing(ex. list[0:5]) 하려고 할 때 발생하는 에러다. 경험상 주로 현재 변수의 자료형을 오인해 해당 에러가 발생하곤한다. slicing 하려고 했던 변수와 변수의 type을 출력해보면 무엇이 잘못됐는지 쉽게 찾을 수 있다.
반응형