Opposite of split
Alex van der Spek
zdoor at xs4all.nl
Mon Aug 16 12:26:46 EDT 2010
Thanks much,
Nope, no homework. This was a serious question from a serious but perhaps
simple physicist who grew up with Algol, FORTRAN and Pascal, taught himself
VB(A) and is looking for a replacement of VB and finding that in Python. You
can guess my age now.
Most of my work I do in R nowadays but R is not flexible enough for some
file manipulation operations. I use the book by Lutz ("Learning Python").
The join method for strings is in there. I did not have the book at hand and
I was jetlagged too. I do apologize for asking a simple question.
I had no idea that some would go to the extent of giving trick solutions for
simple, supposedly homework questions. Bear in mind Python is a very feature
rich language. You cannot expect all newbies to remember everything.
By the way, I had a working program that did what I wanted using still
simpler string concatenation. Replaced that now by tab.join([lines[i][k][2]
for i in range(5)]), k being a loop counter. Judge for yourself. That is the
level I am at after 6 weeks of doing excercises from my programming book on
Pascal in Python.
Thanks for the help. I do hope there is no entry level for using this group.
If there is, I won't meet it for a while.
Alex van der Spek
"D'Arcy J.M. Cain" <darcy at druid.net> wrote in message
news:mailman.2159.1281917130.1673.python-list at python.org...
> On 15 Aug 2010 23:33:10 GMT
> Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
>> Under what possible circumstances would you prefer this code to the
>> built-
>> in str.join method?
>
> I assumed that it was a trap for someone asking for us to do his
> homework. I also thought that it was a waste of time because I knew
> that twenty people would jump in with the correct answer because of
> "finally, one that I can answer" syndrome.
>
> --
> D'Arcy J.M. Cain <darcy at druid.net> | Democracy is three wolves
> http://www.druid.net/darcy/ | and a sheep voting on
> +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
More information about the Python-list
mailing list