Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64119

Re: Python solve problem with string operation

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.szaf.org!feedme.news.telefonica.de!telefonica.de!diesel.cu.mi.it!.POSTED!not-for-mail
From giacomo boffi <pecore@pascolo.net>
Newsgroups comp.lang.python
Subject Re: Python solve problem with string operation
Date Fri, 17 Jan 2014 01:38:02 +0100
Organization The Sun and the Rain.
Lines 14
Message-ID <877g9za1ed.fsf@pascolo.net> (permalink)
References <mailman.5607.1389911083.18130.python-list@python.org> <87eh47a2d3.fsf@pascolo.net>
NNTP-Posting-Host ppp-151-0.21-151.libero.it
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace virtdiesel.mng.cu.mi.it 1389919082 7774 151.21.0.151 (17 Jan 2014 00:38:02 GMT)
X-Complaints-To abuse@diesel.cu.mi.it
NNTP-Posting-Date Fri, 17 Jan 2014 00:38:02 +0000 (UTC)
User-Agent Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.5-b34 (linux)
Cancel-Lock sha1:pLDWKWk57XfpjekOwZ17kCi/wAk=
Xref csiph.com comp.lang.python:64119

Show key headers only | View raw


giacomo boffi <pecore@pascolo.net> writes:

> % python a.py
> 34131237

% cat a.py 
i="344111133311222223377";n=0
while n+1!=len(i):i,n=(i[:n]+i[n+1:],n) if i[n+1]==i[n] else (i,n+1)
print i
% python a.py 
34131237
%
-- 
for Nikos

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python solve problem with string operation Nac Temha <naccttemha@gmail.com> - 2014-01-17 00:24 +0200
  Re: Python solve problem with string operation John Gordon <gordon@panix.com> - 2014-01-16 22:30 +0000
    Re: Python solve problem with string operation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-16 22:48 +0000
      Re: Python solve problem with string operation John Gordon <gordon@panix.com> - 2014-01-16 22:58 +0000
  Re: Python solve problem with string operation giacomo boffi <pecore@pascolo.net> - 2014-01-17 01:17 +0100
    Re: Python solve problem with string operation giacomo boffi <pecore@pascolo.net> - 2014-01-17 01:38 +0100
  Re: Python solve problem with string operation Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-17 00:30 +0000
  Re: Python solve problem with string operation "Rhodri James" <rhodri@wildebst.org.uk> - 2014-01-17 01:05 +0000
  Re: Python solve problem with string operation Asaf Las <roegltd@gmail.com> - 2014-01-16 17:36 -0800

csiph-web