how to compare elements in a list of lists and compare keys in a list of lists in python?,len(set(a))