[Python] One-liner to apply same function to each element of an array? [duplicate]

Discussão em 'Python' iniciado por Stack, Agosto 27, 2025.

  1. Stack

    Stack Membro Participativo

    What would be the pythonic (ideally, one-liner) way to apply to implement the following (considering a known number of returned values -- 3 in this example) ?

    tmp1, tmp2, tmp3 = f(params)
    x1, x2, x3 = g(tmp1), g(tmp2), g(tmp3)


    Thank you!

    Continue reading...

Compartilhe esta Página