Two newbie questions

Moshe Zadka moshez at math.huji.ac.il
Tue Jun 13 14:27:42 EDT 2000


On Tue, 13 Jun 2000, BuCoDI-Rony Steelandt wrote:

> Don't know exactly what you mean, could it be that??
> st = "asdfasfasdf"
> l = []
> for c in st:
>     l.append(c)
> #process here
> #....
> #now get string back
> s=''
> for c in l:
>     s= s+ c

Don't do that! That's O(n^2) rather then O(n)....
See my other reply for a more efficient way.





More information about the Python-list mailing list