Wednesday, March 24, 2010

Python convert String to List

>>> l=eval('[1,[2,4],3]')
>>> l
[1, [2, 4], 3]
>>> l[0]
1
>>> l[1]
[2, 4]

No comments: