Answers for "python split string unwanted character"

1

split a string with 2 char each in python

a_string = "abcde"

n = 2
split_strings = [a_string[index : index + n] for index in range(0, len(a_string), n)]
Posted by: Guest on September-19-2021
0

python split string every character

s = "foobar"
s = list(s)
print(s)

<output: ['f', 'o', 'o', 'b', 'a', 'r']>
Posted by: Guest on September-25-2021

Code answers related to "python split string unwanted character"

Python Answers by Framework

Browse Popular Code Answers by Language