码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2018-04-30 11:47:01      阅读:699      评论:0      收藏:0      [点我收藏+]

标签:obj   函数   opera   trouble   back   method   target   win10   UI   

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

标签:obj   函数   opera   trouble   back   method   target   win10   UI   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!