[Tutor] The better Python approach
Vince Teachout
teachv at taconic.net
Wed Jan 21 14:59:08 CET 2009
jadrifter wrote:
>>>> a = '1234 5678 1 233 476'
>>>> a.split()
> ['1234', '5678', '1', '233', '476']
>
> Where the '>>>' are the command prompt from python. Don't type those.
> A space is the default split delimiter. If you wish to use a '-' or new
> line feed them as strings to the split method.
>
Ok, that's it. That was the last straw. I'm digging up my copy of
"Dive into Python" and starting today!
More information about the Tutor
mailing list