[Python] What is the difference between (x, y) = func() and x, y = func() when func returns a...

Discussão em 'Python' iniciado por Stack, Abril 14, 2025.

  1. Stack

    Stack Membro Participativo

    If I have a function like this, for example:

    def test()
    return (1, 2)

    x, y = test()
    (x, y) = test()


    What is the difference between the last two lines? Are they essentially equivalent or is there something I should know about best practices?

    Continue reading...

Compartilhe esta Página