K
Kristofer Pettijohn
My question is about lists:
Is there a way to remove duplicate items from a list that are
next to each other?
Example...
Performing the operation on ['a', 'b', 'c', 'c', 'd', 'd', 'd', 'e']
will return ['a', 'b', 'c', 'd', 'e']
Performing the operation on ['a', 'b', 'c', 'c', 'd', 'c', 'd', 'e']
will return ['a', 'b', 'c', 'd', 'c', 'd', 'e']
I'm guessing there is probably nothing internal that will do it, so
I may have to write something on my own - just thought I'd check
first
Thanks!
Is there a way to remove duplicate items from a list that are
next to each other?
Example...
Performing the operation on ['a', 'b', 'c', 'c', 'd', 'd', 'd', 'e']
will return ['a', 'b', 'c', 'd', 'e']
Performing the operation on ['a', 'b', 'c', 'c', 'd', 'c', 'd', 'e']
will return ['a', 'b', 'c', 'd', 'c', 'd', 'e']
I'm guessing there is probably nothing internal that will do it, so
I may have to write something on my own - just thought I'd check
first
Thanks!