Stripping whitespace

John Machin sjmachin at lexicon.net
Wed Jan 23 14:10:16 EST 2008


On Jan 24, 5:50 am, ryan k <r... at ryankaskel.com> wrote:
> Hello. I have a string like 'LNAME
> PASTA               ZONE'. I want to create a list of those words and
> basically replace all the whitespace between them with one space so i
> could just do lala.split(). Thank you!
>
> Ryan Kaskel

So when you go to the Python interactive prompt and type firstly
    lala = 'LNAME     PASTA     ZONE'
and then
    lala.split()
what do you see, and what more do you need to meet your requirements?



More information about the Python-list mailing list