有人能告诉我为什么这个代码不能工作吗?你知道吗
list=[5,9,2,5,13]
item=input("Please enter the search item.")
found=false
for search = 0 to list.length -1
if item==list[search]:
found= True
next search
if found==True:
print("The item is in the list.")
else:
print("The item is not in the list.")
你至少应该用更好的方式写,比如:
这就是你想要的:
我不确定它的语法,也不确定它是否真的是python。我建议你先看看教程。你知道吗
但是,您可以这样搜索列表中的元素:
相关问题 更多 >
编程相关推荐