You have to examine the whole list, before giving up the search.
Change from
Quote:
def linear_Search(name,target):
for i in range(len(name)):
if name[i]==target:
return i
else:
return -1
to
def linear_Search(name,target):
for i in range(len(name)):
if name[i]==target:
return i
return -1