Python: Run length encoding

visit shbcf.ru