Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

extract list from string python

# Extract list from a str
import ast
input = "[[1,2,3],['c',4,'r']]"
output = ast.literal_eval(input)
output
=> [[1, 2, 3], ['c', 4, 'r']]
 
PREVIOUS NEXT
Tagged: #extract #list #string #python
ADD COMMENT
Topic
Name
4+9 =