Answers for "make a list from str"

0

convert list of strings to string

string Something = string.Join(",", MyList);
Posted by: Guest on August-25-2020
0

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])])
Posted by: Guest on September-16-2020

Python Answers by Framework

Browse Popular Code Answers by Language