how to compare all elements of one list with all elements of another list code example
Example 1: python compare each item of one list
import itertools
for a, b in itertools.combinations(mylist, 2):
compare(a, b)
Example 2: how to make every item compare the rest items of list in python
for i in range(len(mylist)):
for j in range(i + 1, len(mylist)):
compare(mylist[i], mylist[j])