I have a list that will always be of even length.
mylist = ['a', 'b', 'c', 'd', 'e', 'f']
What's the best way I can turn it into this:
mylist = ['ab', 'cd', 'ef']
I have this, and it works, but it seems hugely verbose:
myotherlist = []
for x in xrange(0, len(mylist), 2):
myotherlist.append(mylist[x] + mylist[x + 1])
Which returns this:
>>> myotherlist
['ab', 'cd', 'ef']