On 2007-05-12, Cesar G. Miguel <[EMAIL PROTECTED]> wrote:

> Actually I'm trying to convert a string to a list of float numbers:
> str = '53,20,4,2' to L = [53.0, 20.0, 4.0, 2.0]

>>> str = '53,20,4,2'

>>> [float(w) for w in str.split(',')]

[53.0, 20.0, 4.0, 2.0]

>>> map(float,str.split(','))

[53.0, 20.0, 4.0, 2.0]

-- 
Grant Edwards                   grante             Yow!  I want you to
                                  at               MEMORIZE the collected
                               visi.com            poems of EDNA ST VINCENT
                                                   MILLAY... BACKWARDS!!
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to