[Trouble Shooting - Python] TypeError: 'builtin_function_or_method' object is not subscripta
Posted break大蜗牛
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Trouble Shooting - Python] TypeError: 'builtin_function_or_method' object is not subscripta相关的知识,希望对你有一定的参考价值。
1. Background: python 3/win10
2. Error Line:
idx = nums.index[target-operand1]
3. Solution
index()是对list的函数,所以要用圆括号,而不是方括号
idx = nums.index(target-operand1)
以上是关于[Trouble Shooting - Python] TypeError: 'builtin_function_or_method' object is not subscripta的主要内容,如果未能解决你的问题,请参考以下文章
trouble shooting1--MacBook Pro 终端连接上云主机
Mysql create constraint foreign key faild.trouble shooting method share
[Trouble Shooting - Python] ValueError: source code string cannot contain null bytes
trouble shooting(Cannot determine embedded database driver class for database type NONE)
trouble shooting2-安装完centos7虚拟机,使用不了ls命名
[Trouble Shooting - Python] TypeError: 'builtin_function_or_method' object is not subscripta