Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python3 create list from string

input = ['word1, 23, 12','word2, 10, 19','word3, 11, 15']
output = []
for item in input:
    items = item.split(',')
    output.append([items[0], int(items[1]), int(items[2])])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #list #string
ADD COMMENT
Topic
Name
8+6 =