Remove duplicates


Can anyone tell me what I go wrong in my code I get the right answer from another answer but coudln't find out what go wrong with my code

def remove_duplicates(lis):
    for i in lis:
        if i in newlis:
    return newlis




where does lis1 come from? Its undefined

you are not allowed to modify the list passed into the function (lis)


actullly its a fault
earlier I modified the code second line as

lis1 = lis
and change every "lis" as "lis1" but still I got wrong

sorry for the mistake


is your problem solved now? If not, post an updated version of your code + question


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