list("string") # ["s", "t", "r", "i", "n", "g"]
s = "foobar"
s = list(s)
print(s)
<output: ['f', 'o', 'o', 'b', 'a', 'r']>
txt = "foobar"
print(list(txt)) # ["f", "o", "o", "b", "a", "r"]
a_string = "abcde"
n = 2
split_strings = [a_string[index : index + n] for index in range(0, len(a_string), n)]
def split(word):
return [char for char in word]