Remove Duplicates, code works, weird response?

def remove_duplicates(namaste):
    om = []
    for i in range(len(namaste)-1):
        if namaste[i] == namaste[i+1]:
    return om

Above is my code. For some reason Codecademy responds with: Oops, try again. Your remove_duplicates modifies the list that was passed to it. [4, 5, 5, 4] was modified to [4, 4, 5, 5]. Perhaps you should make a copy first!
I know there is a different way to do it using the hint, but I was curious as to why my code was not accepted? Thank you!


Your code looks correct, but Codecademy only takes a certain response to move on.