I have a list of strings similar to this list:
tags = (\'apples\', \'apricots\', \'oranges\', \'pears\', \'peaches\')
How should I go about
>>> for i, j in itertools.groupby(tags, key=lambda x: x[0]): print(i, list(j)) a ['apples', 'apricots'] o ['oranges'] p ['pears', 'peaches']