blist = [0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0]
string = 'stackoverflow'
output = []
previous = not blist[0]
for b, s in zip(blist, string):
    char = '-' if b == 0 else s
if previous == b:
    output[-1] += char
else:
    output.append(char)
previous = b
print(output)
Форматировать строку по двоичному списку