What was wrong with my code


#1

Could someone tell me what was wrong with my code please? T_T

def remove_duplicates(a):
new_list = []
for i in range(len(a)):
if i not in new_list:
new_list.append(i)
return new_list


remove_duplicates([4, 5, 5, 4]) resulted in an error
#2

In the above, i is the index, not the value.

    if x[i] not in new_list: