Given this sample, which finds unique elements while being available to tell the element source
source_list = ["one", "two", "three", "four", "five"]
diff_list = ["zero", "one", "two", "three", "four", "six", "seven"]
source_unique = []
diff_unique = []
for entry in source_list:
if entry not in diff_list:
source_unique.append(entry)
for entry in diff_list:
if entry not in source_list:
diff_unique.append(entry)
print("Unique elements in source_list: {0}".format(source_unique))
print("Unique elements in diff_list: {0}".format(diff_unique))
###
# Unique elements in source_list: ['five']
# Unique elements in diff_list: ['zero', 'six', 'seven']
is there a more efficient way to do this instead of using two additional lists and all that stuff? The main task is to be able to tell the elements' origin.