Friday, August 10, 2012

Python: Split a string into array with each character

use list() mehod:


numbers = "342"
lst = list(numbers)
print lst // ['3','4','2']

Reference:
http://ubuntuforums.org/showthread.php?t=541931

No comments: