Python solve problem with string operation

Nac Temha naccttemha at gmail.com
Thu Jan 16 17:24:40 EST 2014


Hi everyone,

I want to do operation with chars in the given string. Actually I want to
grouping the same chars.

For example;

input : "344111133311222223377"
operation-> (3)(44)(1111)(333)(11)(22222)(33)(77)
output: "34131237"



How can I do without list, regular expression. just using string
operations. Using an effective methods of python for this problem.


Thanks,
Best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140117/e8e2619b/attachment.html>


More information about the Python-list mailing list