This is the error message I received:
remove_duplicates([4, 5, 5, 4]) returned  instead of [4, 5]
The assignment is to remove duplicates from a list, which I named x.
I am brand new to this, so I am sure to be doing some very silly or odd mistakes… I apologize in advance
I am not sure if it is possible to use the range function for this.
Also, if it necessary to increase n every time one goes through the loop in a for loop with a specified range? I mean, wouldn’t the loop stop after n has exceeded the range?
def remove_duplicates(x): new_list= for n in range(0,len(x)-1): if x[n] not in new_list: new_list.append(x[n]) n=+1 return new_list