string to list p y code example
Example 1: python convert string to list
fruit = 'apple oranges banans'
newlist = fruit.split()
print(newlist)
Example 2: string to list python
s = 'hello'
l = list(s)
print(l) # prints ['h', 'e', 'l', 'l', 'o']
fruit = 'apple oranges banans'
newlist = fruit.split()
print(newlist)
s = 'hello'
l = list(s)
print(l) # prints ['h', 'e', 'l', 'l', 'o']