+ 1
Question about lists
How can I make a list from given strings without spaces? ex: string='hey hi' my_list=list[string] then my_list will be ['h', 'e', 'y', ' ', 'h', 'i']
1 ответ
+ 5
Hi 최호준
You want to make a list of the characters in your string? Just use the list() function:
my_string = "spam"
my_list = list(my_string)
print(my_list) # Output: ['s', 'p', 'a', 'm']
Hope that helps :)