I’ve been using something like this to take a string and break it down to add to a list
example_string = "Test"
example_list =[]
for x in example_string:
example_list.append(x)
Output:
example_list = ['T','e','s','t']
Is there a more direct way to do this?
You mean something better than :
Ouput :
In python strings are iterable like list or tuples, you can easily transform a string into a tuple or a list by calling
tuple()orlist()on it.