We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
def linear_search(lst, target): for i in range(len(lst)): if lst[i] == target: return i return -1 print(linear_search([1, 4, 5, 2, 8], 5)) # Output: 2 print(linear_search([1, 4, 5, 2, 8], 10)) # Output: -1