追溯说:
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)
我基本上想做的是将
n
的索引t
设置为int(raw_input)
。 最佳答案
raw_input
是一个函数,您需要调用它并将该调用的结果传递给int()
:
n = int(raw_input())