python extract list from string

Solutions on MaxInterview for python extract list from string by the best coders in the world

showing results for - "python extract list from string"
Elias
18 Feb 2016
1import ast
2input = "[[1,2,3],['c',4,'r']]"
3output = ast.literal_eval(input)
4output
5=> [[1, 2, 3], ['c', 4, 'r']]