I've the following array with multiple repetitions and I want to remove them mantaining the order.
v = ['maier', 'tapa pure', 'embega', 'maier', 'tapa pure', 'embega', 'maier', 'tapa pure', 'embega', 'maier', 'tapa pure', 'embega', 'maier', 'tapa pure', 'embega', 'maier', 'tapa pure', 'embega', 'maier', 'tapa pure', 'embega', 'maier', 'tapa pure', 'embega']
I use list(set(v))
and I get the following output:
['embega', 'maier', 'tapa pure']
What I want to have is to remove the repetition, but maintain the original order:
['maier', 'tapa pure', 'embega']
I cant use v[:3]
because the repetitions length is variable.
How can I do it?
Thanks in advance.