-1
我正在運行以下程序,它會產生以下故障。我認爲這個邏輯是對的。哪裏不對?以10爲底的int()的無效文字:'63,'
invalid literal for int() with base 10: '63,'
代碼:
for i in range(length):
k=i+1
if (sample_text[i] == "r" and sample_text[k] == "e"):
iTemp = i
iTemp = iTemp + 9
var = ""
finalList = []
while (sample_text[iTemp] != "]"):
iTemp = iTemp + 1
while (sample_text[iTemp] != "," or sample_text[iTemp] != "]"):
tempVar = sample_text[iTemp]
var = var + tempVar
num = int(var)
iTemp = iTemp + 1
您試圖包含一個逗號整數字符串轉換。什麼是不明確的錯誤信息? – timgeb