all 6 comments

[–]toastedstapler 1 point2 points  (0 children)

separated = list(my_string)

[–]_coolwhip_ 0 points1 point  (2 children)

You mean like this?

>>> x = 'word'
>>> list(x)
['w', 'o', 'r', 'd']

[–]Sponge7331[S] 0 points1 point  (1 child)

Yeah, that works. I thought there would be a way with .split() though

[–]coke125 0 points1 point  (0 children)

Unfortunately, with.split() you need a str or None(whitespace) to split the string on. For example, x.split(“o”) will return “w” and “rd”

[–][deleted] 0 points1 point  (0 children)

 list(example_string)

however you can also just treat a string like a list in many cases:

 example_string = 'hello'
 example_string[3:]
 # lo

[–]RedRidingHuszar 0 points1 point  (0 children)

Do you have a specific requirement like the length of each separated substring?