how to make string into a list python code example

Example 1: python convert string to list

fruit = 'apple oranges banans'
newlist = fruit.split()
print(newlist)

Example 2: convert string to list python

word = "Hey Hello world"
print(list(word))
# output
# ["Hey", "Hello", "world"]

Example 3: 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])])