sup i'm pretty bad at this but i'm trying to learn python but i don't really understand why this isn't working. all i want to do is run an unordered sequential search but nothing happens when i run this.
def sequentialSearch(alist, item):
pos = 0
found = False
while pos < len(alist) and not found:
if alist[pos] == item:
found = True
else:
pos = pos+1
return found
def main():
alist = random.sample(range(0, 1000000), 10000)
sequentialSearch(alist[0:1000], 9)
main()
manually typing this in the python shell works though
>>> alist = random.sample(range(0, 1000000), 10000)
>>> sequentialSearch(alist[0:1000], 9)
False
i know i'm missing something small and dumb but i can't seem to fix it lol
print()to output result to console.None.