I'm using the def function and the for or the while loop to create a program that can find the nearest hundreds for a given number.
Asked
Active
Viewed 14 times
0
-
Try dividing by 100 -> Rounding -> Multipling by 100 -> convert to int – NameVergessen Jun 27 '22 at 23:20
-
You just need [`round`](https://docs.python.org/3/library/functions.html#round). Look at the result of `print(round(155, -2))`. – Matthias Jun 27 '22 at 23:20