📅  最后修改于: 2022-03-11 14:45:37.244000             🧑  作者: Mango
def linear_search(a, key):
position = 0
flag = False
while position < len(a) and not flag:
if a[position] == key:
flag = True
else:
position = position + 1
return flag