Notifications
Clear all

Python program to remove all duplicate elements from the list.

   RSS

0
Topic starter

Output Example:
[2,3,4,5,6,2,4,1,3,]

[2,3,4,5,6,1]

1 Answer
0
Topic starter

lst=[2,3,2,12,4,5,3,12,3]

i=0

while(i<len(lst)):

    j=i+1

    while(j<len(lst)):

        if(lst[i]==lst[j]):

            del(lst[j])

        j=j+1

    i=i+1

print(lst)

Share: