ruby %w equivalent

John Machin sjmachin at lexicon.net
Mon Sep 25 00:32:20 CEST 2006


Antoine De Groote wrote:

>
> is there a python equivalent for the ruby %w operator?
> %w{a b c} creates an array with strings "a", "b", and "c" in ruby...
>

| >>> "a b c".split()
| ['a', 'b', 'c']

... appears to match your single example.

HTH,
John




More information about the Python-list mailing list