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
- labelme2coco問題:TypeError: Object of type 'int64' is not JSON serializableErrorObjectJSON
- react 和redux整合報TypeError: Object(...) is not a functionReactReduxErrorObjectFunction
- TypeError: object() takes no parametersErrorObject
- python去掉excel空格和換行,報錯'int' object has no attribute 'strip'PythonExcelObject
- js報錯:TypeError: Date is not a constructorJSErrorStruct
- TypeError: Object of type ‘datetime‘ is not JSON serializableErrorObjectJSON
- pytorch 踩坑,TypeError: expected seqence object with len>_0 or a single integer_typeerror: expected sequence object with len __ 0PyTorchErrorObject
- TypeError: The ‘compilation‘ argument must be an instance of Compilation 報錯Error
- Django程式碼中的TypeError 'float' object is not callableDjangoErrorObject
- Django報錯ValueError: invalid literal for int() with base 10:DjangoError
- el-tree 報錯 TypeError: Cannot read property ‘setCheckedKeys‘ of undefined“ErrorUndefined
- VUE前端打包報錯:TypeError: Class extends value undefined is not a constructor or nullVue前端ErrorUndefinedStructNull
- python報錯:TypeError: slice indices must be integers or None or have an __index__ methodPythonErrorNoneIndex
- TypeError: Cannot read private member xxx from an object whose class did not declare itErrorObject
- Pycharm:設定完Anaconda後報錯TypeError: an integer is required (got type bytes)PyCharmErrorUIGo
- python用pyinstaller生成exe時報錯 TypeError: an integer is required (got type bytes)PythonErrorUIGo
- object dict cannot be used in await expression報錯解釋ObjectAIExpress
- Ajax 報錯jquery-3.3.1.min.js:2 Uncaught TypeError: Cannot use 'in' operator to seajQueryJSError
- yolov5 train報錯:TypeError: expected np.ndarray (got numpy.ndarray)YOLOAIErrorGo
- npm報錯 TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.Received undefineNPMError
- Rasa init報錯:AttributeError: type object 'Callable' has no attribute '_abc_registry'ErrorObject
- springboot開發介面報錯Optional int parameter 'userId' is present but cannot be translated into a null v......Spring BootNull
- Uncaught TypeError: external_echarts_.helper.createTextStyle is not a functionat Object.seriesModel.layoutInstance.ondraw問題的解決ErrorEchartsFunctionObject
- R語言ggsurvplot繪製生存曲線報錯 : object of type ‘symbol‘ is not subsettableR語言ObjectSymbol
- int[] 、 list<int> 、 list<int>[] 的區別
- 訪問資料庫出現Object reference not set to an instance of an object錯誤資料庫Object
- C語言之int *f()、int(*f)()、int *a[]、int (*a)[] 區別小記C語言
- 呼叫torchtext報錯OSError: libtorch_cpu.so: cannot open shared object file: No such file or directoryErrorObject
- TypeError: “ModelBase is not iterable”Error
- TypeError: SizeOnlySource is not a constructorErrorStruct
- TypeError: stringWidth is not a functionErrorFunction
- 【C#】Newtonsoft.Json 中 JArray 新增陣列報錯:Could not determine JSON object type for typC#JSONJAR陣列Object
- 素數判定(int sushu(int n))
- vue-專案中less報錯 Module build failed: TypeError: loaderContext.getResolve is not a function問題解決以及安裝lessVueUIAIErrorContextFunction
- Uncaught TypeError: i is not a functionErrorFunction
- Uncaught TypeError: $(...).attr(...) is undefinedErrorUndefined
- 記錄一次WPF命令引數報錯,InvalidCastException: T for DelegateCommand<T> is not an object nor Nullable.ASTExceptionObjectNull