"Paul McGuire" <[EMAIL PROTECTED]> writes:

> ... or if you prefer the functional approach (using map)...
>
> roundToInt = lambda z : int(z+0.5)
> Topamax = map( roundToInt, map( float, map(str, Topamax) ) )
>
> (Python also has a built-in round() function, but this returns floats, not
> ints - if that is okay, then just delete the lambda definition, and replace
> roundToInt with round.)

Your roundToInt behaves differently from round for negative numbers:

>>> roundToInt(-0.6)
0
>>> int(round(-0.6))
-1

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Skencil                                           http://skencil.org/
Thuban                                  http://thuban.intevation.org/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to