[Python] How to write python lambda with multiple lines? [duplicate]

Discussão em 'Python' iniciado por Stack, Maio 30, 2025.

  1. Stack

    Stack Membro Participativo

    In python, how can you write a lambda function taking multiple lines. I tried

    d = lambda x: if x:
    return 1
    else
    return 2


    but I am getting errors...

    Continue reading...

Compartilhe esta Página