On  6 Feb 2005, [EMAIL PROTECTED] wrote:

> Actually, generating the digits from the right complicates the algorithm quite
>       a bit. It's hidden in
> the Python version, but s = str(i % 2) + s is a relatively expensive 
> operation here - it has to copy 
> all of s to make room for the new digit.

Because of that the standard answer is to write:

s = []
s.append(...)
return ''.join(s)



   Karl
-- 
Please do *not* send copies of replies to me.
I read the list
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to