Alex Rivera | Logout

How do I convert string characters into a list?

Asked 2012-05-15T23:23:33.023
27

Possible Duplicate:
How to create a list with the characters of a string?

Example:

'abc'

becomes

['a', 'b', 'c']

Is it a combination of split and slicing?

Edit
Report

1 Answer

66
>>> x = 'abc'
>>> list(x)
['a', 'b', 'c']

Not sure what you are trying to do, but you can access individual characters from a string itself:

>>> x = 'abc'
>>> x[1]
'b'
answered 2012-05-15T23:25:11.277

Your Answer