I expect the output of the following code
def unique_in_order(iterable):
    new = []
    for letter in iterable:
        new.append(letter)
    n = len(new)
    for i in range(n):
        if new[i] == new[i+1]:
            new.pop(i)
    return new
print(unique_in_order('AAAABBBCCDAABBB'))
to be ['A','B','C','D','A','B']
Why do I get the "list index out of range" error?
 
     
     
     
    