python - Format a string with a space between every two digits -
input: string = 53434951
i need split string output reads: 53 43 49 51
you use like:
s = "534349511" print ' '.join([s[i:i+2] in range(0,len(s),2)])
note work lists of uneven length -- you'll have single digit @ end, after space.
Comments
Post a Comment