How can I remove duplicate characters from a string using Python? For example, let\'s say I have a string:
foo = \"SSYYNNOOPPSSIISS\"
How c
Using itertools.groupby:
>>> foo = "SSYYNNOOPPSSIISS" >>> import itertools >>> ''.join(ch for ch, _ in itertools.groupby(foo)) 'SYNOPSIS'