[Python] format names from a list of objects into a string

Discussão em 'Python' iniciado por Stack, Março 15, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to insert the names from a list of objects into a string, but I have a hard time comprehending list comprehension before I can come up with a way to add a spacer between them.

    "need {}".format(i.name for i in lst))


    what's the right way to do it?

    Continue reading...

Compartilhe esta Página