Remove_duplicates working correctly (maybe) not proving succcessful


Stuck @ remove_duplicates

Prints as if correct output, won't count it as successful (sorry if its something stupid but I thought it might be something importiant...)

def remove_duplicates(numbers):
    results = numbers
    for num in numbers:
        if numbers.count(num) > 1:
            for i in range(1,numbers.count(num)):
    return results


Your new list in not in the correct order...



results = numbers

will make a variable referring to the same list, not make a copy of the list

Remove is a really difficult approach, are you certain you want to do this?

You might want to add some print statements, to see that too much gets removed


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