On Sun, 18 May 2008 19:13:57 +0100, J. Clifford Dyer
<[EMAIL PROTECTED]> wrote:
On Sun, May 18, 2008 at 07:06:10PM +0100, Matt Porter wrote regarding
Compress a string:
Hi guys,
I'm trying to compress a string.
E.g:
"BBBC" -> "ABC"
The code I have so far feels like it could be made c
> I'm trying to compress a string.
> E.g:
>
> "BBBC" -> "ABC"
Doesn't preserve order, but insures uniqueness:
line = "BBBC"
print ''.join( set( line ) )
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, May 18, 2008 at 07:06:10PM +0100, Matt Porter wrote regarding Compress
a string:
>
> Hi guys,
>
> I'm trying to compress a string.
> E.g:
> "BBBC" -> "ABC"
>
> The code I have so far feels like it could be made clearer and more
> succinct, but a solution is currently escaping me.