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
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηVisible tests
1
Input
93Expected
True2
Input
90Expected
True3
Input
89Expected
False4
Input
195Expected
True5
Input
205Expected
True6
Input
150Expected
FalseFocus radio
Paused · SomaFM · Fluid