What is wrong with this? Practice Makes Perfect remove_duplicates



I made a new variable to return, but it says i didn't

i expected lists_ to equal everything in lists, making everything in lists to make a new one

Replace this line with your code. 
def remove_duplicates(lists):
    lists_ = []
    for i in lists:
        if i == i:
            lists_ = lists[0:]
    return lists_


this line:


modifies the original list passed into the function, which is what is causing the error. You might want to modify this, if you need further assistant with it, let me know. (post an updated version of your code. Good luck :slight_smile:


how would i set lists to a new variable? I tried using lists_ = lists but that wouldnt work.


you have use the lists function:

lists_ = list(lists)

but i think the method you have now is better. Well done, i on purpose only gave you a small push in the right direction, i believe this teaches you more then a full answer.

Good to hear you resolved it :slight_smile: