[lang-ref] ( map_with_named_function ) ( python )

def test_map_with_named_function():
    def multiply_by_two(x):
        return x * 2

    items = [1, 2, 3]

    r = list(map(multiply_by_two, items))

    assert r == [2, 4, 6]