Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
The implementation of linear search covered in the course is provided below.
def linear_search(lst, target):
"""Returns the index position of the target if found, else returns -1"""
for i in range(0, len(lst)):
if lst[i] == target:
The code can be cleaned up a bit by using the enumerate function...
I forgot my password