0

The loops are not working properly maybe cause the program cannot remove all duplicates.

Here is the code i wrote:

data=[10,10,10,10,20,30,40,50,30]
i=1
for num in data:
    while 0<=i<=len(data)-1:
        if num==data[i]:
            data.remove(data[i])
            i=i+1
        else:i=i+1
print(data)

[10, 10, 20, 30, 40, 50, 30] And this is the output.

0 Answers0