+ 2
How to round floats in Python?
I try to round number and i use round() function but it didn't work,can any body help me?
2 Respostas
+ 4
Kaleab Alemayehu , it would be great when you can share your code with us here. So we see where you get stuck. Thanks!
+ 3
The built-in round() function will round to the nearest integer if a precision argument is not passed with the number.
I.E. round(2.5452) will return 3
where round(2.5452, 2) will return 2.55
Note: decimal behavior may not be exact due to floating point arithmetic issues
https://docs.python.org/3/library/functions.html#round