Junior — Senior
Проверка результата функции при нулевом значении параметра length
livecode
Task condition
It is necessary to call the function foo, setting its length to 0. It is important to understand what list will be returned when the length parameter is 0.
def foo(length: int = 10) -> list[int]:
is_minus = length < 0
return [i if not is_minus else -i for i in range(abs(length)) if i % 2 == 0]