Mid2 30th_Remove_Duplicates_from_List

 def remove_duplicates(l):

    unlist=[]
    for i in l:
        if i not in unlist:
            unlist.append(i)
    print(unlist)

l=[1,2,2,3,2,4]
remove_duplicates(l)
#output:
[1, 2, 3, 4]

Comments

Popular posts from this blog

JAVA Lab Programs

HANGMAN GAME

WD 22. StylingLinks&Buttons