split

Maik Röder roeder at berg.net
Fri Jun 11 14:16:54 CEST 2004


Hi!

Joachim Bauch wrote:
> an even faster way would be
> 
> |>> s = 'another string'
> |>> l = [ch for ch in s]
> |>> l
> ['a', 'n', 'o', 't', 'h', 'e', 'r', ' ', 's', 't', 'r', 'i', 'n', 'g']

Or shorter:

 >> s = 'some string'
 >> l = list(s)
 >> l
 >> ['s', 'o', 'm', 'e', ' ', 's', 't', 'r', 'i', 'n', 'g']

Best regards,

Maik Röder





More information about the Python-list mailing list