Sobes.tech
Junior — Senior

Support for both positive and negative function parameters

livecode

Task condition

The currently implemented function works correctly only for positive values of the argument length. It needs to be modified so that it handles negative values of length properly.


def foo(length: int = 10) -> list[int]:
    return [i for i in range(length) if i % 2 == 0]

Support for both positive and negative function… - sobes.tech