[Python] Python's lambda with underscore for an argument?

Discussão em 'Python' iniciado por Stack, Fevereiro 5, 2025.

  1. Stack

    Stack Membro Participativo

    What does the following code do?

    a = lambda _:True


    From what I read and tested in the interactive prompt, it seems to be a function that returns always True.

    Am I understanding this correctly? I hope to understand why an underscore (_) was used as well.

    Continue reading...

Compartilhe esta Página