A problem with the debugger


it should work, but it wont. the debugger has bugs. ichecked with another interpter and it worked. how would i reprot it?

def remove_duplicates(withDup) :
    single = []
    temp = withDup[0]
    for num in withDup :
        if num != temp :
        temp = num
    return single


@itamarfeig ,

Your remove_duplicates function modifies the original list that is passed to it, which Codecademy does not want it to do. That is one reason why it is not accepted as a solution. In addition to that, the function raises an error if it is passed an empty list, because here you assume there is at least one item in the list ...



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