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

1 Answer

0 votes
n = 140

print(round(n, -2) + 100 if round(n, -2) < n else round(n, -2))

n = 170

print(round(n, -2) + 100 if round(n, -2) < n else round(n, -2))




'''
run:

200
200

'''

 



answered Mar 10, 2023 by avibootz
...