How do you remove duplicates from an array?

 In python it is simple program

  1. list = [1,3,4,6,3,1,8,9,6] 
  2. print ("The original list is : " + str(list)) 
  3. list1 = [] 
  4. for i in list: 
  5. if i not in list1: 
  6. list.append(i) 
  7. print ("The list after removing duplicates : " + str(list1)) 

Output:

  1. The original list is : [1,3,4,6,3,1,8,9,6] 
  2. The list after removing duplicates : [1,2,4,6,8,9] 

Comments

Popular posts from this blog

proassignment help backlink data index 41

Programming shark backlink data index 67

AHM Backlink Data Index 95