int() 参数必须是字符串或数字,而不是 'builtin_function_or_method' - python

int() argument must be a string or a number, not 'builtin_function_or_method' - python

回溯说:

Traceback (most recent call last):
  File "dex.py", line 37, in <module>
    n=int(raw_input)
TypeError: int() argument must be a string or a number, not 'builtin_function_or_method'

和代码:

t[n]=1

其中 t 是 t=[0, 0, 0, 0, 0, 0, 0, 0, 0 ,0] n 是 int(raw_input)

我基本上想做的是将 t 的索引 n 设置为 int(raw_input)

raw_input是一个函数,你需要调用它并传递结果 调用 int():

n = int(raw_input())