有什麼錯我的代碼給我的錯誤: 類型錯誤:指數的名單必須是整數,而不是str的類型錯誤:索引列表必須是整數,而不是str的
這裏是我的代碼:
print("This programe will keep track of your TV schedule.")
Finish = False
Show = []
ShowStart = []
ShowEnd = []
while not Finish:
print()
ShowName = input("What is the shows name?: ")
if ShowName == "":
Finish = True
else:
ShowStartTime = input("What time does the show start?: ")
ShowEndTime = input("What time does the show end?: ")
Show.append(ShowName)
ShowStart.append(ShowStartTime)
ShowEnd.append(ShowEndTime)
print("{0:<10} | {1:<10} | {2:<10} ".format("Show Name", "Start Time", "End Time"))
for each in Show:
print("{0:<10} | {1:<10} | {2:<10} ".format(Show[each], ShowStart[each], ShowEnd[each]))
input()
當你用Google搜索「類型錯誤:索引列表必須是整數,不是str「 - 對你沒有幫助/你從結果中不瞭解什麼? –