table = [1, 10, 5]
table2 = [10]
def find_difference(a, b):
for items in a:
print("yes")
if items in b:
print("happened")
a.remove(items) *#breaks after this*
return a
print(find_difference(table, table2))
I'm trying to find the difference between two list. After this function runs the 'runlog' only shows the word "yes" twice which means the for loop is breaking after the if statement executes. I re-arranged the 'table' list and put the 10 last to see if that was so, and it was. The 'runlog' shows the correct amount of "yes". This makes me believe it has to do directly with the remove() and pop() functions (since I tried them both). Again I'm not sure