🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #529

Re: Mezclar string

#529
From: Rodrigo Barrientos L.
Date: Thu, 06 Mar 2008 14:37
16 lines
1607 bytes
    Waaah.. por eso me gusta python :)

>>> s1='1235'
>>> s2='67829'
>>> ''.join([(s1[i] if i < len(s1) else '') + (s2[i] if i < len(s2) else '') for i in range(max(len(s1), len(s2)))])
'162738529'

    Conciso y preciso (si bien algo atadoso de entender).

-- 
[Signature changing tool.. to proceed, press 'Shift-C-^T', then enter
'Abracadabra', then..]

Insanity is considered a ground for divorce, though by the very same
token it is the shortest detour to marriage.
		-- Wilson Mizner
Technical Details
Message-ID: <fqovjn$tea$1@helcaraxe.dcc.uchile.cl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!fu-berlin.de!news.nivel5.cl!news.cec.uchile.cl!helcaraxe.dcc.uchile.cl!not-for-mail
References: <3394b760-72db-46a1-a587-80153b21be4c@i29g2000prf.googlegroups.com> <Xns9A58AEBD24FD9jmsnews@201.238.250.229> <80a9289e-ea0a-4618-9ccc-170a4a54032e@p73g2000hsd.googlegroups.com> <2bb9b53b-5593-4dae-8090-fb53244b760a@e25g2000prg.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,43187c159ac77009
X-Google-Attributes: gid1593cb,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!fu-berlin.de!news.nivel5.cl!news.cec.uchile.cl!helcaraxe.dcc.uchile.cl!not-for-mail
From: "Rodrigo Barrientos L." <robarrie@dcc.uchile.cl>
Newsgroups: chile.comp.programacion
Subject: Re: Mezclar string
Date: Thu, 6 Mar 2008 14:37:43 +0000 (UTC)
Organization: DCC - Universidad de Chile
Lines: 16
Message-ID: <fqovjn$tea$1@helcaraxe.dcc.uchile.cl>
References: <3394b760-72db-46a1-a587-80153b21be4c@i29g2000prf.googlegroups.com> <Xns9A58AEBD24FD9jmsnews@201.238.250.229> <80a9289e-ea0a-4618-9ccc-170a4a54032e@p73g2000hsd.googlegroups.com> <2bb9b53b-5593-4dae-8090-fb53244b760a@e25g2000prg.googlegroups.com>
NNTP-Posting-Host: anakena.dcc.uchile.cl
X-Trace: helcaraxe.dcc.uchile.cl 1204814263 30154 192.80.24.6 (6 Mar 2008 14:37:43 GMT)
X-Complaints-To: newsmaster@dcc.uchile.cl
NNTP-Posting-Date: Thu, 6 Mar 2008 14:37:43 +0000 (UTC)
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/2.6.23-gentoo-r8 (i686))