import random numArray = [0]*10 #create an array/list of 10 elements for i in range(len(numArray)): #len(numArray) is the same as 10 #populate the array numArray[i] = random.randint(1,20) #display the contents print(f"numArray[{i}] : {numArray[i]}") #start linear search found = False searchItem = int(input("Enter a search item: ")) for i in range (len(numArray)): if numArray[i] == searchItem: found = True #end of linear search if found == False: print(f"{searchItem} is not in the array!") else: print(f"{searchItem} is in the array!")