1. Background: python 3/win10
2. Error Line:
idx = nums.index[target-operand1]
3. Solution
index()是对list的函数,所以要用圆括号,而不是方括号
idx = nums.index(target-operand1)
1. Background: python 3/win10
2. Error Line:
idx = nums.index[target-operand1]
3. Solution
index()是对list的函数,所以要用圆括号,而不是方括号
idx = nums.index(target-operand1)
转载于:https://www.cnblogs.com/break-dawnn/p/8972882.html