counts = collections.Counter(patterns)
for poss in itertools.product(alphabet, repeat=num):
    print(', '.join(group) + ':', end=' ')
print(''.join(poss), counts[poss])
Python count all possible combinations for a table