create a list from a string python code example

Example 1: how to make a list string in python

n = ["Hello"," I'm " , "12" , " Years Old "] # Our list
String = "" # Our string
for x in n :
    String += x
    
print(String) #Prints it

Example 2: string to list python

s = 'hello'
l = list(s)
print(l) # prints ['h', 'e', 'l', 'l', 'o']

Example 3: how to convert a string to a list python

#How to split a string into a list (Python)

#"separator" should be replaced with the string you want to split with
string.split("separator")

Example 4: how to convert a list to a string in python

array = []
STR = ''
for i in array:
    STR = STR+i

Example 5: convert string to list python

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