I was so miffed at not reading the OP's mail carefully that I wrote a one liner.
Ok. Here it goes:
def no_adjacent_dup(lst):
return [ x for x, y in zip(lst, lst[1:]) if x != y] + [lst[-1]]
:-) Enjoyed working that one out; but whether it is a good solution ....
Asokan Pichai
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
