Rounding Question

Mike Callahan mcalla at home.com
Thu Feb 22 14:35:46 EST 2001


How about this, (taking advantange of the round function)?

>>> def rounded(n):
 return int(round(n+4, -1))

>>> rounded(10)
10
>>> rounded(11)
20
>>> rounded(19)
20
>>> rounded(111)
120
>>>

Mike Callahan





More information about the Python-list mailing list