here's the code:
def findsort(something, alist):
for item in alist:
if item == something:
return "found"
else:
return "not found"
def main():
print(findsort(6, [3, 6, 1, 8, 11, 14]))
main()
for some reason, this doesn't work the way i thought it should work.
when i run this, it will say "not found." however, if i change the value i want to find to the first item in the list, the 3, it comes back as "found."
i have tried this with strings, and i get the same results.
can someone please tell me what i am doing wrong?