Compress a string

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Tue May 20 04:21:30 EDT 2008


Salvatore DI DI0 a écrit :
(top-post corrected - Salvatore, please, don't top-post)
> "Matt Porter" <mabbikeel at gmail.com> a écrit dans le message de news: 
> mailman.1315.1211133997.12834.python-list at python.org...
>> Hi guys,
>>
>> I'm trying to compress a string.
>> E.g:
>>  "AAAABBBC" -> "ABC"

 > Try this
 >
 > t = set("aaaaaaaaaaaabbbbbbbbbbccccccccc")
 > list(t)

Won't keep the ordering.





More information about the Python-list mailing list