-2
building = [["Farm","-1","0","F","1","1","-1"],
["Plot","0","0","P","1","0","-1"],
["House","20","4","H","0","0","5"]]
cmd = input(">")
if (cmd == "build"):
c = 0
length = len(building)
while (c < length):
bu = building(c)
print(c + ") " + bu[0])
c = c + 1
順便說一句,使用e = sys.exc_info()
我得到:
(<class 'TypeError'>, TypeError("'builtin_function_or_method' object is not
subscriptable",), <traceback object at 0x7f3393e23d88>)
請分享更多的代碼。你想完成什麼? –
什麼是「建築」?你能分享更多的堆棧跟蹤嗎? – AChampion
什麼在建築?嘗試打印(類型(建設)) –