b = {'S1': ['N0', 'N1'], 'S2': ['N0']}
assert list(a.keys()) == list(b.keys())
merged = {k: ''.join(alternate(a[k], b[k], '')) for k in a}
print(merged)
merging two dictionaries of lists with the same keys in python