python convert string to list code example
Example 1: convert string to list python
word = 'abc'
L = list(word)
L
word = 'a,b,c'
L = word.split(',')
L
Example 2: python convert string to list
fruit = 'apple oranges banans'
newlist = fruit.split()
print(newlist)
Example 3: string to list python
s = 'hello'
l = list(s)
print(l)
Example 4: python string to tuple
l = list('abcd')
l = map(None, 'abcd')
l = [i for i in 'abcd']
import re
l = re.findall('.', 'abcd')
print(l)
Example 5: how to convert a string to a list python
string.split("separator")
Example 6: convert string to list python
word = "Hey Hello world"
print(list(word))