stripping punctuation from tuples

Louis Luangkesorn lluang at northwestern.edu
Wed Mar 21 02:49:21 CET 2001


Yep, I finally got it to work.

Wayne Izatt wrote:

> Is this what you're looking for?
>
> >>> a = []
> >>> a.append(('Alan Tsang',))
> >>> a
> [('Alan Tsang',)]
> >>> a[0]
> ('Alan Tsang',)
> >>> b = a[0]
> >>> b
> ('Alan Tsang',)
> >>> (x, y) = string.split(str(b[0]))
> >>> x, y
> ('Alan', 'Tsang')
> >>> x
> 'Alan'
> >>> y
> 'Tsang'
> >>>
>
> cheerio

--
K Louis Luangkesorn
lluang at northwestern.edu  http://pubweb.nwu.edu/~kll560  PGP:0xF3E2D362
Whatsoever things are true, ... honest, ... just, ... pure, ... lovely, ... of
good report; if there be any virtue, and if there be any praise, think on
these things.- motto - Northwestern University





More information about the Python-list mailing list