I am trying to create a function in which it removes duplicates from a list, but
it fails whenever there is a 1
in the list. It works for all the other numbers
and I am not sure what is causing this. There is an array with some numbers.
It’s guaranteed that array contains more than 3 numbers.
def find_uniq(arr):
new_list = []
for i in arr:
if i not in new_list:
new_list.append(i)
# this returns the second value in new_list as there are two values in the list.
return new_list[1]