b = list('abc')
len_ab = len(a) + len(b)
groups = groupby(((a[len(a) * i // len_ab], b[len(b) * i // len_ab]) for i in
    range(len_ab)), key=lambda x: x[0])
[j[i] for k, g in groups for i, j in enumerate(g)]
How to elegantly interleave two lists of uneven length in python?