Odd Numbers in Range

Sometimes you need to quickly count how many numbers with a certain property fall inside a range, without checking each one manually. Given non-negative integers low and high, count the odd numbers from low to high, inclusive. Return that count.

Примеры

Ввод
3, 7
Вывод
3
Ввод
8, 10
Вывод
1
Ввод
0, 0
Вывод
0

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

def count_odds(low: int, high: int) -> int:

Теги

math
PostgreSQLv16
Entre para enviar

O resultado da execução do código aparecerá aqui

Visible tests
1
Input
3, 7
Expected3
2
Input
8, 10
Expected1
3
Input
0, 0
Expected0
4
Input
1, 1
Expected1
5
Input
2, 9
Expected4
6
Input
8, 11
Expected2
Focus radio
Paused · SomaFM · Fluid