Paul McGuire wrote:
> ... or if you prefer the functional approach (using map)...
> 
> roundToInt = lambda z : int(z+0.5)
> Topamax = map( roundToInt, map( float, map(str, Topamax) ) )

Somehow, the list comprehension looks simpler and clearer to me:

     Topamax = [int(float(uni) + .5) for uni in Topamax]

I really dislike lines like:
     roundToInt = lambda z : int(z+0.5)

You've already chosen a name, but you'd rather write in the lisp style.

     def roundToInt(z):return int(z+0.5)

takes all of _one_ more character.

I also don't understand why you convert to string from unicode in:

     ... map(str, Topamax) ) )

float works on all string types (including unicode), and will accept 
some non-ASCII digit values.

-- 
-Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to