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
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
BejelentkezésTests12
Visible tests
Rejtett teszt 7
Rejtett teszt 8
Rejtett teszt 9
Rejtett teszt 10
Rejtett teszt 11
Rejtett teszt 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