def compare(E1, E2):
    i, j = 0, 0
I, J = len(E1), len(E2)
while i < I:
    if j >= J or E1[i] < E2[j]:
        print((E1[i], 'is not in E2'))
i += 1
Best way to compare two large sets of strings in Python