xxxxxxxxxx
var = "Hello World!" #create a string
lenght = len(var) # Get it's lenght as an int
list = [] # Make a new list to store each letter
for i in range(lenght): # Add each letter to the list
list.append(var[i])
#list.remove(" ") # Remove spaces (Optional)
print(list) # Show yor list!
xxxxxxxxxx
def split(word):
return [char for char in word]
# Driver code
word = 'geeks'
print(split(word))
#Output ['g', 'e', 'e', 'k', 's']