I'm a beginner to Python, and right now doing linear searches. This is a code to search the item the user has entered from an index stored in a computer. However I have 2 syntax errors that I can't work around. Any help would be useful.
upperbound = 7
lowerbound = 0
arr = [0 for i in range(7)]
print("Please enter item to be found: ")
item = input("Please Enter Item To Be Found: ")
Found = False
index = lowerbound
while (found = True) or (index > upperbound):
if item = arr[index]
found = True
break
index = index + 1
if found:
print("Item Found")
else:
print("Item Not Found")
Aucun commentaire:
Enregistrer un commentaire