Python int() to the nearest value -
the way python int()
function works rounds number smallest value.
such 4.99 = 4
what can if want 4.99 equal 5?
int()
truncates float values, removing non-integral portion of number. looking rounding instead.
you can use round()
function that:
>>> round(4.99) 5
Comments
Post a Comment