Grouping a dictionary of lists based on  % key and the first value in the list
1. Review


There's no docstring. What does groupCount do? The text in the post explains it very clearly, so using this would be a good start.
groupCount has two responsibilities: (i) it collates the input into groups, and (ii) it prints the collated results. The trouble with combining responsibilities like this is that it makes it hard to reuse the code. If you need to use the groups in other code, how do you get them? If you want to write automatic test cases, how do you do that? It would be better to split the grouping and printing code into separate functions. (This is the "single responsibility principle".)
This code iterates over the indexes in the sequence counts and then looks up the item using counts[i].

for i in range(len(counts)):
    # code using i and counts[i]


Python provides the function enumerate for simultaneously iterating over items and their indexes:

for i, count in enumerate(counts):
    # code using i and count

For collating items based on their keys, it is handy to use collections.defaultdict, like this:

groups = defaultdict(list)
for i, count in enumerate(counts):
    groups[count].append(i)

To split a sequence into groups of length \$n\$, there's a well-known trick that's described in the documentation for zip, where it says:


  This makes possible an idiom for clustering a data series into n-length groups using zip(*[iter(s)]*n). This repeats the same iterator n times so that each output tuple has the result of n calls to the iterator. This has the effect of dividing the input into n-length chunks.

There is no need to pass a key function to sort. Sequences are compared lexicographically by their items, and because we know that all the items are different, the comparison will never have to look past the first item.


2. Revised code

from collections import defaultdict

def group_by_count(counts):
    """Given a sequence of group sizes for each item, return a list of
    groups, each group being a tuple of indexes of items.

    &gt;&gt;&gt; group_by_count([3, 3, 3, 3, 3, 1, 3])
    [(0, 1, 2), (3, 4, 6), (5,)]

    """
    groups = defaultdict(list)
    for i, count in enumerate(counts):
        groups[count].append(i)
    result = []
    for count, group in groups.items():
        result.extend(zip(*[iter(group)] * count))
    return sorted(result)


(Note the example in the docstring: this can be automatically checked using the doctest module.)