Answers for "remove duplicates from sorted lsit"

1

Remove duplicates from list

# removing duplicated from the list using naive methods 

# initializing list 
sam_list = [11, 13, 15, 16, 13, 15, 16, 11] 
print ("The list is: " + str(sam_list)) 

# remove duplicated from list 
result = [] 
for i in sam_list: 
    if i not in result: 
        result.append(i) 

# printing list after removal 
print ("The list after removing duplicates : " + str(result))
Posted by: Guest on May-31-2021
1

sort and remove duplicates list python

myList = sorted(set(myList))
Posted by: Guest on June-25-2020

Code answers related to "remove duplicates from sorted lsit"

Python Answers by Framework

Browse Popular Code Answers by Language