def remove_duplicates(namaste): om =  namaste.sort() for i in range(len(namaste)-1): if namaste[i] == namaste[i+1]: pass else: om.append(namaste[i]) om.append(namaste[len(namaste)-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!