Write a program to remove duplicate elements in a list and print the list


Topic: Write a program to remove duplicate elements in a list and print the list

Solution

test_list = [1, 3, 5, 6, 3, 5, 6, 1] 
print ("The original list is : " +  str(test_list)) 
  
res = [] 
for i in test_list: 
    if i not in res: 
        res.append(i) 
  
print ("The list after removing duplicates : " + str(res))



List all Python Programs