[ad_1]
int() truncates float values, removing the non-integral portion of the number. You are looking for rounding instead.
You can use the round() function for that:
>>> round(4.99)
5
[ad_2]
solved Python int() to the nearest value
[ad_1]
int() truncates float values, removing the non-integral portion of the number. You are looking for rounding instead.
You can use the round() function for that:
>>> round(4.99)
5
[ad_2]
solved Python int() to the nearest value