Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how ot split a string every fourth eter

>>> line = '1234567890'
>>> n = 2
>>> [line[i:i+n] for i in range(0, len(line), n)]
['12', '34', '56', '78', '90']
Comment

PREVIOUS NEXT
Code Example
Python :: python discord bot join voice channel 
Python :: epoch to datetime python 
Python :: python get current time in seconds 
Python :: all permutation from 2 arrays python 
Python :: python file size 
Python :: how to install pandas datareader in conda 
Python :: how to get the size of an object in python 
Python :: pandas insert column in the beginning 
Python :: ctypes run as administrator 
Python :: return result from exec python 
Python :: tkinter bind to window close 
Python :: django makemigrations comand 
Python :: plot specific columns pandas 
Python :: each line in a text file into a list in Python 
Python :: set cuda visible devices python 
Python :: how to read docx file in python 
Python :: discord py on ready 
Python :: pip install arcpy python 3 
Python :: pandas select rows with values in a list 
Python :: infinity in python 
Python :: sklearn roc curve 
Python :: python most common element in list 
Python :: pandas determine percentage of nans in column 
Python :: python gui capture user input 
Python :: how to print a random part of a list in python 
Python :: python dictionary remove nonetype 
Python :: python copy dir 
Python :: how to make computer go in sleep mode using pythn 
Python :: pandas add character to string 
Python :: standardize columns in pandas 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =