首页 > 编程语言 > 详细

[Trouble Shooting - Python] TypeError: 'builtin_function_or_method' object is not subscriptable

时间:2018-04-30 10:46:15      阅读:1058      评论:0      收藏:0      [点我收藏+]

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 subscriptable

原文:https://www.cnblogs.com/break-dawnn/p/8972882.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!