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

Related questions

1 answer 108 views
1 answer 101 views
1 answer 137 views
1 answer 131 views
1 answer 136 views
1 answer 121 views
1 answer 156 views
...