What was wrong with my code


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:
return new_list

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

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

    if x[i] not in new_list: