python create a string from a string list code example
Example 1: how do i convert a list to a string in python
lines2 = " ".join(lines) # Converts the list to a string.
# This should work for writing to a file
file.write(lines2)
Example 2: 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])])