How to round up an integer to the next thousands in Python

1 Answer

0 votes
n = 1300

print(round(n, -3) + 1000 if round(n, -3) < n else round(n, -3))

n = 1800

print(round(n, -3) + 1000 if round(n, -3) < n else round(n, -3))




'''
run:

2000
2000

'''

 



answered Mar 10, 2023 by avibootz
...