Even or Odd

Checking parity is one of the most common small checks in programming, from filtering lists to simple game rules. Write even_or_odd, which takes an integer n. If the number is even, return the string even; if it is odd, return odd.

Примеры

Ввод
0
Вывод
"even"
Ввод
1
Вывод
"odd"
Ввод
2
Вывод
"even"

Нужно реализовать

def even_or_odd(n: int) -> str:

Теги

math
PostgreSQLv16

Itt jelenik meg a kód futtatásának eredménye

Visible tests
1
Input
0
Expected"even"
2
Input
1
Expected"odd"
3
Input
2
Expected"even"
4
Input
-3
Expected"odd"
5
Input
100
Expected"even"
6
Input
7
Expected"odd"
Focus radio
Paused · SomaFM · Fluid