from itertools import groupby

def collapser(txt):
    return ''.join(item for item, grp in groupby(txt))

if __name__ == '__main__':
    strings = [
            ,
            ' --- Abraham Lincoln ',
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ]
    for txt in strings:
        this = 
        print(f )
        this = 
        sqz = collapser(txt)
        print(f )