I have to find the difference between a list with another list.
But this process of finding the difference totally randomizes my output every time I run.
Below is my script
getALL = ["apple","ball","cat","dog","eagle"] // initial list
Sourcee = ["eagle", "ball"]
diff = list(set(getALL) - set(Sourcee))
for items in diff:
print(items)
Is there any way to keep the sequence of the the diff
list same as getALL
?
I want my output like this:
apple
cat
dog