我有一個包含元組的列表。每個元組擁有2個元素。我試着用下面的代碼打印出來,但它給人的錯誤消息: TypeError: list indices must be integers or slices, not tuple 相關代碼: for i in list:
for j in [1, 2]:
print(list[i][j])
隨着打印1元組的每個元素的想法,每個元素第
之前聲稱這個問題是重複的 我發現了一個similar question posted here。我認爲這是因爲我正在使用python3,但我收到TypeError: unsupported operand type(s) for +: 'dict_items' and 'dict_items'和AttributeError: 'dict' object has no attribute 'iter