Remove_duplicates code don't work


while working on remove_duplicates i tried this code but i got error that my list returns empty
my code:

def remove_duplicates(x):
    for i in x:
        if x.count(i) <=1:
            return y
        return y

Replace this line with your code.


a function ends the moment a return a keyword is reached. If the function is executing a loop, the loop simply breaks


aha, i get it. Really thanks for the help


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