有什么错我的代码给我的错误: 类型错误:指数的名单必须是整数,而不是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“ - 对你没有帮助/你从结果中不了解什么? –