Answers for "how to divide string by number of characters python"

1

python dividing strings by amount of letters

>>> line = '1234567890'
>>> n = 2
>>> [line[i:i+n] for i in range(0, len(line), n)]
['12', '34', '56', '78', '90']
Posted by: Guest on June-24-2021
1

python split string in characters

s = "foobar"
list(s)
['f', 'o', 'o', 'b', 'a', 'r']
Posted by: Guest on January-25-2021

Code answers related to "how to divide string by number of characters python"

Python Answers by Framework

Browse Popular Code Answers by Language