Rom*_*man 4 python dictionary tuples list
我有这个简单的程序:
x = {}
x[1,2] = 3
print x
print x[1,2]
Run Code Online (Sandbox Code Playgroud)
它工作正常.拳头print
生成{(1,2):3}
,第二个生成3
.
但在我的"大"程序中,我似乎做了同样的但是得到了一个list indices must be integers, not tuple
错误.此错误消息的含义以及如何解决此问题?