Close to Ten

This kind of logic is useful when you need to know whether a number is close to a clean round marker. Write a function near_ten that takes a non-negative number num. Return True if the number is no more than 2 away from the nearest multiple of 10. Otherwise, return False.

Примеры

Ввод
12
Вывод
True
Ввод
17
Вывод
False
Ввод
19
Вывод
True

Нужно реализовать

def near_ten(num: int) -> bool:

Теги

math
PostgreSQLv16

Här visas resultatet av din kod

Tests12
Visible tests
Dolt test 7
Dolt test 8
Dolt test 9
Dolt test 10
Dolt test 11
Dolt test 12

They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.

Focus radio
Paused · SomaFM · Fluid