If I have a list like:
[u'test_1', u'test_2', u'test_3', u'bananas_4', u'cake_5', u'bananas_6']
What would be the best way to just get the following without knowing anything else in advance?
[u'test_1', u'bananas_4', u'cake_5']
So how I see it, would be something like loop over the list, store the test
and bananas
somehow, and if on another iteration, see another of the same start of the string, remove that from the list.
Does anyone know the best way of achieving this?