I am trying to convert a string to list and as a newbie don't know what's the easiest way to do that.
Having the list, for example:
strList = "[[1,2,3],[4,5,6]]"
is there any python function that simply splits the string above?
I tried to use the method .split()
but it returns
>>> list("[[1,2,3],[4,5,6]]".split())
['[[1,2,3],[4,5,6]]']
What I would like to get is
result = [[1,2,3],[4,5,6]]
so the result[0]
would return [1,2,3]
and
result[0][1]
would return 2