i guess, it is pythonchallenge.com level 10? if so, i used this thing: import re def enc(s): return ''.join('%s%s' % (len(a[0]),a[0][0]) for a in re.findall('((.)\\2*)', s))
-- http://mail.python.org/mailman/listinfo/python-list
i guess, it is pythonchallenge.com level 10? if so, i used this thing: import re def enc(s): return ''.join('%s%s' % (len(a[0]),a[0][0]) for a in re.findall('((.)\\2*)', s))
-- http://mail.python.org/mailman/listinfo/python-list