from itertools import groupby

def squeezer(s, txt):
    return ''.join(item if item == s else ''.join(grp)
                   for item, grp in groupby(txt))

if __name__ == '__main__':
    strings = [
            ,
            ' --- Abraham Lincoln ',
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ]
    squeezers = ' ,-,7,., -r,e,s,a,'.split(',')
    for txt, chars in zip(strings, squeezers):
        this = 
        print(f )
        for ch in chars:
            this = f
            sqz = squeezer(ch, txt)
            print(f )