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

1 Answer

0 votes
n = 13

print(round(n, -1) + 10 if round(n, -1) < n else round(n, -1))

n = 17

print(round(n, -1) + 10 if round(n, -1) < n else round(n, -1))




'''
run:

20
20

'''

 



answered Mar 10, 2023 by avibootz
...