1.python報錯:TypeError: 'int' object is not subscriptable
subscriptable:可以使用下表來訪問資料
- 此報錯一般是在整數上加了下標
In [20]: a = [("a","b"),("c","d"),"e"]
In [21]: a[2][0]
Out[21]: 'e'
In [22]: a[2][1]
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-22-2e4ed419d949> in <module>()
----> 1 a[2][1]
IndexError: string index out of range
In [23]: a = [("a","b"),("c","d"),3]
In [24]: a[2][0]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-24-adb924ee4885> in <module>()
----> 1 a[2][0]
TypeError: 'int' object is not subscriptable
相關文章
- Python報錯:TypeError: a bytes-like object is required, not ‘str‘PythonErrorObjectUI
- react 和redux整合報TypeError: Object(...) is not a functionReactReduxErrorObjectFunction
- TypeError: object() takes no parametersErrorObject
- labelme2coco問題:TypeError: Object of type 'int64' is not JSON serializableErrorObjectJSON
- Uncaught TypeError: Object [object Object] has no method 'xxx'ErrorObject
- js報錯:TypeError: Date is not a constructorJSErrorStruct
- python去掉excel空格和換行,報錯'int' object has no attribute 'strip'PythonExcelObject
- JAVA int 強制型別轉換錯誤提示(Cannot cast from Object to int)Java型別ASTObject
- Uncaught TypeError: Object # has no method 'load'ErrorObject
- pytorch 踩坑,TypeError: expected seqence object with len>_0 or a single integer_typeerror: expected sequence object with len __ 0PyTorchErrorObject
- TypeError: Object of type ‘datetime‘ is not JSON serializableErrorObjectJSON
- TypeError: The ‘compilation‘ argument must be an instance of Compilation 報錯Error
- js 函式報錯“Uncaught: TypeError xxx is not a function”JS函式ErrorFunction
- TypeError:a.replaceisnotafunction錯誤ErrorFunction
- Django程式碼中的TypeError 'float' object is not callableDjangoErrorObject
- Django報錯ValueError: invalid literal for int() with base 10:DjangoError
- VUE前端打包報錯:TypeError: Class extends value undefined is not a constructor or nullVue前端ErrorUndefinedStructNull
- svn報錯“Previous operation has not finished; run 'cleanup' if it was int
- python報錯:TypeError: slice indices must be integers or None or have an __index__ methodPythonErrorNoneIndex
- el-tree 報錯 TypeError: Cannot read property ‘setCheckedKeys‘ of undefined“ErrorUndefined
- Ajax 報錯jquery-3.3.1.min.js:2 Uncaught TypeError: Cannot use 'in' operator to seajQueryJSError
- Pycharm:設定完Anaconda後報錯TypeError: an integer is required (got type bytes)PyCharmErrorUIGo
- yolov5 train報錯:TypeError: expected np.ndarray (got numpy.ndarray)YOLOAIErrorGo
- object dict cannot be used in await expression報錯解釋ObjectAIExpress
- TypeError: Cannot read private member xxx from an object whose class did not declare itErrorObject
- npm報錯 TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.Received undefineNPMError
- object-c中NSString與int和float的相互轉換Object
- java 反射 報錯:Attempt to get java.lang.Integer field "..." with illegal data type conversion to intJava反射
- (int)a、&a、(int)&a、(int&)a的區別
- python解析json檔案報錯No JSON object could be decodedPythonJSONObject
- int[] 、 list<int> 、 list<int>[] 的區別
- C語言之int *f()、int(*f)()、int *a[]、int (*a)[] 區別小記C語言
- springboot開發介面報錯Optional int parameter 'userId' is present but cannot be translated into a null v......Spring BootNull
- R語言ggsurvplot繪製生存曲線報錯 : object of type ‘symbol‘ is not subsettableR語言ObjectSymbol
- Rasa init報錯:AttributeError: type object 'Callable' has no attribute '_abc_registry'ErrorObject
- Uncaught TypeError: external_echarts_.helper.createTextStyle is not a functionat Object.seriesModel.layoutInstance.ondraw問題的解決ErrorEchartsFunctionObject
- Uncaught TypeError: $(...).attr(...) is undefinedErrorUndefined
- TypeError: “ModelBase is not iterable”Error