MyHaz wrote:
> ''.join(['Thank ','you])
^^ Syntax error ...
Probably better as:
' '.join(['Thank', 'you'])
;)
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Guys It Was Great Help and I have began to mark my code for the
''.join() string conatination optimization. Upon regoogling (when you
know the right thing to google it can make a big diffrence, having not
know how to google +=, hehe). I found this commentary and set of tests.
I find it a goo
Edg Bamyasi schrieb:
What is the running time of conactination on character strings.
i.e.
.>>>joe="123"
.>>>joe+="9"
is it Amortized Constant time? I don't think it would be O((number of
chars)^2) but i really don't know.
First of all, this idiom is generally avoided in loops (where
Edg Bamyasi wrote:
What is the running time of conactination on character strings.
i.e.
joe="123"
joe+="9"
is it Amortized Constant time? I don't think it would be O((number of
chars)^2) but i really don't know.
Strings are immutable, so
joe+="9"
is executed as
joe
> "Haz" == MyHaz <[EMAIL PROTECTED]> writes:
Haz> Teach me how to fish, where would i find out more about the
Haz> internal representations of data types in python
The source.
Experimentally you can use the timeit command to see how it performs:
% for i in 10 20 40 80 160 320 640 1