How to round up an integer to its nearest tens or hundreds or thousands in Python

1 Answer

0 votes
print(round(2501, -3))
print(round(250, -2))
print(round(24, -1))
print(round(13, -1))
print(round(16, -1))



'''
run:

3000
200
20
10
20

'''

 



answered Mar 10, 2023 by avibootz
...