Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python split word into letter pairs

string = 'ABCDXY'
[string[i:i+2] for i in xrange(0, len(string), 2)]
Comment

python split word into letter pairs

s = 'abcdef'
L = zip(s[::2], s[1::2])
# -> [('a', 'b'), ('c', 'd'), ('e', 'f')]
Comment

PREVIOUS NEXT
Code Example
Python :: python drop the first word 
Python :: to_csv create folder 
Python :: take screenshot of video python 
Python :: url settings 
Python :: split word python 
Python :: count down for loop python 
Python :: python call function from string 
Python :: python code for where to save the figures 
Python :: python add one 
Python :: python list 
Python :: python json normalize 
Python :: time 
Python :: print( n ) in python 
Python :: how to create 3 dimensional array in numpy 
Python :: python code to exe file 
Python :: ln in python 
Python :: python multiple inheritance 
Python :: how yo import python lib 
Python :: find duplicated entries present in a list 
Python :: def function in python 
Python :: random in python 
Python :: random.choice 
Python :: tab of nbextensions not showing in jupyter notebook 
Python :: ping from python 
Python :: urllib request 
Python :: python partial 
Python :: python character list to string 
Python :: matrix inverse python without numpy 
Python :: stack queue in python 
Python :: python script to copy files to remote server 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =