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
Влез, за да видиш историята на решенията
ВходВлез, за да използваш ИИ ментора
ВходTests12
Visible tests
Скрит тест 7
Скрит тест 8
Скрит тест 9
Скрит тест 10
Скрит тест 11
Скрит тест 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