[Tutor] capitalize() but only first letter

Sean 'Shaleh' Perry shalehperry@attbi.com
Wed Feb 5 20:27:06 2003


On Wednesday 05 February 2003 15:51, Erik Price wrote:
>
> Here is the script I ended up with... I'd like to make some additions t=
o
> it, so that if I specify an overloaded setter method it calls the "true=
"
> setter method (the one that actually modifies the property), but it's
> been a long day and I'm going to go home now.
>

it is generally more efficient to do:

l =3D []
l.append('hello')
l.append(' ')
l.append('world')
import string
output =3D string.join('', l) # use an empty string as glue

than it is to use 'hello' + ' ' + 'world', especially when the number of=20
pieces glued together is larger than a handful.