On Sun, Jan 6, 2013 at 1:30 AM, Roy Smith <r...@panix.com> wrote: > In article <mailman.109.1357378077.2939.python-l...@python.org>, > Chris Angelico <ros...@gmail.com> wrote: > >> result = "".join([x[int(x[0])+1:] for x in >> ("0"+s).replace("-","+").split("+")]) > > That's exceedingly clever. But bordering on line noise. At the very > least, I would break it up into a couple of lines to make it easier to > understand (plus you can print out the intermediate values to see what's > going on): > > chunks = ("0"+s).replace("-","+").split("+") > result = "".join([x[int(x[0])+1:] for x in chunks]
Sure. You can always split a one-liner to taste, doesn't much matter where. You could split it majorly into half a dozen lines if you want, doesn't make a lot of diff. It'll work the same way :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list