need help with my append syntax

Michael Ekstrand mekstran at scl.ameslab.gov
Fri Aug 12 13:15:31 EDT 2005


On 12 Aug 2005 09:31:08 -0700
"yaffa" <yxxxxlxxxxx at gmail.com> wrote:
> addr = incident.findNextSibling('td')
> addr.append('%s;')

addr += ';'

or 

addr2 = '%s;' % addr

Strings, being immutable, do not support appending like lists do. Also,
the %whatever specifiers are only in effect when used with the string
formatting operator (%).

-Michael



More information about the Python-list mailing list