Write a Python program to remove duplicates from a list

def func(lst):
    new_list = []
    for item in lst:
        if item not in new_list:            
            new_list.append(item)                   
                
    return new_list



print(func(['abc', '11', 'xyz', 'aba', '1221', '2112', 'xyz', '11', 'aba']))


Follow on:
Sunil Shaw

Sunil Shaw

About Author

I am a Web Developer, Love to write code and explain in brief. I Worked on several projects and completed in no time.

Related Page