Remove_duplicates marked successful but NOT WORKING


Hi everyone Codecademy says that my code is right, but it's not actually removing duplicates like it's supposed to. I can't understand why.

This is my code:

def remove_duplicates(a_list):
    new_list = []
    for number in a_list:
        if number not in new_list:
    return new_list

print ([1,1,2,2])



What makes you say it isn't removing duplicates, got an example of input that it fails on?


so when I asked to print ([1,1,2,2])

it prints [1,1,2,2]


That doesn't involve your function though, you're just printing a list without doing anything with it first


oh wow you're right! Can't believe it was that simple. I must be tired.

Thanks :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.