python 无序表查找
2021-06-20 11:04
标签:else result arc int def pre ret false print python 无序表查找 标签:else result arc int def pre ret false print 原文地址:https://www.cnblogs.com/sea-stream/p/9689104.htmldef sequential_search(lis, key):
for i in range(len(lis)):
if(lis[i] == key):
return i
else:
return False
LIST = [1, 5, 8, 123, 22, 54, 7, 99, 300, 222]
result = sequential_search(LIST, 5)
print(result)
上一篇:python 堆排序
下一篇:Linux 线程调度与优先级