#------------------------------------------------------------------------------
# LinearSearch2.py
#------------------------------------------------------------------------------

def LinSearch(x, L):
   Found = []
   for i in range(len(L)):
      if x == L[i]:
         Found.append(i)
      # end if
   # end for 
   return Found
# end LinSearch()


#-- main program --------------------------------------------------------------

if __name__=='__main__':

   target = 'eight'
   words = ['one','two','three','four','five','six','seven','eight','nine','ten']

   P = LinSearch(target, words)
   print(target, 'found at positions', P)

   target = 50
   numbers = [3, -2, 50, 78, 5, 50]

   P = LinSearch(target, numbers)
   print(target, 'found at positions', P)

   target = 12
   P = LinSearch(target, numbers)
   print(target, 'found at positions', P)

# end if
