Tools_List=["Hoe","Pitchfork","Shovel"] #`list`
print(Tools_List)
Tools=input("What tools do you want? ")
print(Tools_List[Tools])
答案 0 :(得分:0)
只能将一个索引作为时间索引,当您的提示要求“工具”复数时。我建议(使用int校正和小写名称)
tools = ["Hoe","Pitchfork","Shovel"]
print(tools)
tool = int(input("What tool do you want? "))
print(tools[tool])