Check if two nested lists are equivalent upon substitution
问题 For some context, I'm trying to enumerate the number of unique situations that can occur when calculating the Banzhaf power indices for four players, when there is no dictator and there are either four or five winning coalitions. I am using the following code to generate a set of lists that I want to iterate over. from itertools import chain, combinations def powerset(iterable): s = list(iterable) return chain.from_iterable(map(list, combinations(s, r)) for r in range(2, len(s)+1)) def