import retext = "CEEEETTEEEEGGGCCBCTTBHHHHHCCEEEEEEEEETTEETT"print( re.sub(r'(.)(?=(?!\1).)', r'\1 ', text, flags=re.S) )
Standard input is empty
C EEEE TT EEEE GGG CC B C TT B HHHHH CC EEEEEEEEE TT EE TT
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!