24 Jan
2014
24 Jan
'14
11:16 p.m.
24.01.14 23:04, MRAB написав(ла):
On 2014-01-24 20:48, Chris Angelico wrote:
On Sat, Jan 25, 2014 at 7:33 AM, <random832@fastmail.us> wrote:
'aaa'[::-1].replace('aa'[::-1],'x'[::-1])[::-1] 'ax'
It makes me happy when the [::-1] smiley gets used that many times to solve a problem. Very happy.
Happy that it isn't in _my_ code, to be precise...
It's probably not as efficient, either!
Of course it is less efficient than hypothetical rreplace, but I suppose it is most efficient way in current Python.