This code returns an empty list irrespective of the input list. Can't figure the mistake.

def remove_duplicates(input_list):
    for x in range(0,n):
        if input_list[x] not in output_list:
    return output_list


n is zero. Set using the input_list length.


Thanks, so stupid of me!


It happens. You don't deserve that label so push it out of your mind. Go easy on yourself. Expect to make mistakes and expect to fail. It's how we learn. Getting back on the horse and trying again is the best approach.


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