[Python] Does Python have a shortcut for creating arrays like Ruby's %w(things in array)

Discussão em 'Python' iniciado por Stack, Junho 11, 2025.

  1. Stack

    Stack Membro Participativo

    Does Python have a shortcut for creating arrays like Ruby's %w(strings in array)?

    Python seems to make me use the longer syntax of putting " and , around everything in an array I'm creating, which is frustrating and rude.

    Unfortunately I can't find any shorthand for creating arrays. Is there any mechanism built into the language for this?

    Continue reading...

Compartilhe esta Página