1string = '1234567890'
2n = 2 # every 2 characters
3split_string = [string[i:i+n] for i in range(0, len(string), n)]
4# split_string = ['12', '34', '56', '78', '90']
1>>> line = '1234567890'
2>>> n = 2
3>>> [line[i:i+n] for i in range(0, len(line), n)]
4['12', '34', '56', '78', '90']