-1
內部訪問的元組我有一個二維數組,看起來就像這樣:不能二維數組蟒蛇
[[(0, 0), ('', 0), ('', 0), ('', 0), ('', 0), ('', 0)], [(0, 0), ('', 0), ('', 0), ('', 0), ('', 0), ('', 0)]]
我想從這樣一個給定的小區接入元組的值:
x,y = self.cell_array[col][row]
它給我這個錯誤:
TypeError: list indices must be integers, not str
我在做什麼錯?
檢查'col'和'row'值。 – user3 2014-12-03 08:06:41
也許你的索引是字符串而不是整數? – 2014-12-03 08:13:20
難道你不能只讀_錯誤信息嗎? – 2014-12-03 09:08:50