Close to a Marker
Programs often need to check whether a number is close to an important marker, such as 100 or 200. Write a function near_hundred that takes a number n. Return True if it is no more than 10 away from either 100 or 200, otherwise return False.
Примеры
Ввод
93Вывод
TrueВвод
90Вывод
TrueВвод
89Вывод
FalseНужно реализовать
def near_hundred(n: int) -> bool:
Теги
math
Pieslēdzies, lai redzētu iesniegumu vēsturi
PieslēgtiesPieslēdzies, lai izmantotu AI mentoru
PieslēgtiesTests12
Visible tests
Slēptais tests 7
Slēptais tests 8
Slēptais tests 9
Slēptais tests 10
Slēptais tests 11
Slēptais tests 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