SyntaxFix
Write A Post
Hire A Developer
Questions
>>> lst = ['abcd', 'e', 'fg', 'hijklmn', 'opq', 'r'] >>> print [lst[2*i]+lst[2*i+1] for i in range(len(lst)/2)] ['abcde', 'fghijklmn', 'opqr']