String to sequence

Ulrich Eckhardt doomster at knuut.de
Sat Mar 14 10:24:38 CET 2009


mattia wrote:
> How can I convert the following string:
> 
> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
> 
> into this sequence:
> 
> ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ']

import string
string.split("a,b,c", ',')

Now, I'm not 100% clear if this fits your above example because it's not
clear what of the above is Python code and what is actual string content,
but I hope this will get you started.

cheers!

Uli





More information about the Python-list mailing list