M
M
Mikhail Mikhail2021-07-06 11:33:02
Python
Mikhail Mikhail, 2021-07-06 11:33:02

Is there a built in function that can round like below?

10 -> 10
11 -> 15
12 -> 15
13 -> 15
14 -> 15
16 -> 20
18 -> 20

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2021-07-06
@latty337

for i in range(10, 20):
    print(i, i + -i % 5)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question