With a comprehension? Well...
>>> seq = '012345' >>> swapped_pairs = zip(seq[1::2], seq[::2]) >>> ''.join(item for pair in swapped_pairs for item in pair) '103254'
1.4m articles
1.4m replys
5 comments
57.0k users