Answers for "python split word into letter pairs"

0

python split word into letter pairs

string = 'ABCDXY'
[string[i:i+2] for i in xrange(0, len(string), 2)]
Posted by: Guest on May-12-2020
0

python split word into letter pairs

s = 'abcdef'
L = zip(s[::2], s[1::2])
# -> [('a', 'b'), ('c', 'd'), ('e', 'f')]
Posted by: Guest on May-12-2020

Code answers related to "python split word into letter pairs"

Python Answers by Framework

Browse Popular Code Answers by Language