我正在製作一個簡單的python腳本來處理表格。我正在使用數組來存儲單元格值。 繼承人的代碼:'int'對象不可調用
table =[]
hlen = input("Please enter the amount of columns \n")
vlen = input("Please enter the amount of rows \n")
curcol = 1
currow = 1
totcell = hlen*vlen
while (totcell >= curcol * currow):
str = input("Please input "+ str(curcol) +"," + str(currow))
table.append(str)
if (curcol >= hlen):
currow =+ 1
//Process Table
程序運行甜,在1,1詢問的第一個單元格。一切都很好,直到代碼在重新加載時停止。火雞蟒錯誤輸出
Traceback (most recent call last):
File "./Evacuation.py", line 13, in <module>
str = input("Please input "+ str(curcol) +"," + str(currow))
TypeError: 'int' object is not callable
感謝您的任何幫助。
不命名變量'str'(或'input'),你的問題就解決了...... –
'currow = + 1'→'currow + = 1'? – Ryan
使用'pylint'。它會吸取像這樣的常見問題。 – thefourtheye