def 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)

  

相关文章:

  • 2021-08-11
  • 2021-11-18
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
相关资源
相似解决方案