Python Interview Questions

konryd konryd at gmail.com
Wed Oct 31 09:58:15 CET 2007


> - string building...do they use "+=" or do they build a list
>    and use .join() to recombine them efficiently


I'm not dead sure about that, but I heard recently that python's been
optimized for that behaviour. That means: using += is almost as fast
as joining list. Besides, "+=" is more obvious than the other choice
and since performance is not a problem until it's a problem, I'd
rather use it. Anyway: I wouldn't pick it for an interview question.

regards
Konrad




More information about the Python-list mailing list