So this was the question and I implemented it using python language but there is error in code and I am not able to fix it so please help. I am attaching code also.
def delete23(a):
    for i in range(0, len(a) - 1):
        for j in range(0, len(a) - 1):
            if a[i] == a[j] and i != j:
                a.pop(j)
    print(a)


a = [1, 2, 3, 4, 4, 1, 7]
print(len(a))
delete23(a)



Write a Python program to remove duplicates from a list of integers, preserving order
To filter duplicates while preserving the order, a set of seen values is used quite often. The logic is very simple: if a value is not present yet in seen, the value is encountered for the first time.
lst = [1, 2, 3, 4, 4, 1, 7]

seen = set()
lst2 = []
for x in lst:
    if x not in seen:
        seen.add(x)
        lst2.append(x)
    
print(lst2)

With a little trick, this can be shortened:
seen = set()
lst2 = [(seen.add(x) or x) for x in lst if x not in seen]

print(lst2)

To explain the expression inside (...): set.add returns None and (None or VALUE) is evaluated to VALUE

Warning: ALL solutions using a set or a dict require that all values are hashable.
