s ='1'*98while ("1111" in s ): s = s.replace("1111" , "22" , 1) s = s.replace("222" , "1" , 1) print(s)
Standard input is empty
12
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!