Re: [EMAIL PROTECTED]: Re: Compress a string]

2008-05-18 Thread Matt Porter
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

Fwd: Re: [EMAIL PROTECTED]: Re: Compress a string]

2008-05-18 Thread python
> 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

[EMAIL PROTECTED]: Re: Compress a string]

2008-05-18 Thread J. Clifford Dyer
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.