Even or Odd
Write a function even_or_odd that takes an integer n. If it is even, return the string even; if it is odd, return the string odd. A number is even if n % 2 == 0. The if / else statements and the % operator will help — % gives the remainder of a division.
Примеры
Ввод
0Вывод
"even"Ввод
1Вывод
"odd"Ввод
2Вывод
"even"Нужно реализовать
def even_or_odd(n: int) -> str:
Теги
math
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
Σύνδεση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